2013 Oct 31 1:18 PM
hi Experts,
i have read through many posts and was unable to find something to answer my question. I have an XML document that I need to transform into a table and while I know how to do that part, the issue is that the XML document has element attributes that I need values from.
This is the one node specifically that I need help with;
<row sco-id="995088131" type="meeting" icon="meeting">
i need the sco-id. so in my transformation I have
<SCO_ID>
<xsl:value-of select="sco-id"/>
</SCO_ID>
that doesnt work so I tried replacing "sco-id" with "row" and I get the entire contents of that elements attribute values without the attribute names.
My question is, how do I handle the transformation so I can read the element and attribute values by specific attribute?
Thanks experts. I imagine it is something silly but any help would be most appreciated.
Chris
2013 Oct 31 2:11 PM
You can try selecting the attribute by using: select="@sco-id"
@ is used to specify attribute name.
Also try select="row/@sco_id"
2013 Oct 31 2:11 PM
You can try selecting the attribute by using: select="@sco-id"
@ is used to specify attribute name.
Also try select="row/@sco_id"
2013 Oct 31 6:57 PM
Thank you very much!! This has saved me much grief!! I really appreciate everyone's help!!
2013 Oct 31 2:46 PM
Like Manish mentioned you have to use "@" sign to read attribute. For example
/xpath/@sco_id
Regards,
--Ravi