Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pull a node and all xml within

Status
Not open for further replies.

jrenae

Programmer
Jan 18, 2006
142
US
I have a node within a xml file as below and I just want to find the node and pull in the node and all the xml, attributes and values just as is. I tried
Code:
 <xsl:value-of select="//my_matches"/>
But all I get are the values within the elements...how do I just get the node and all of it's contents, including the xml, attributes, elements and values just as is...this is the xml?
Code:
<my_matches>
 <count>2</count>
  <matches>
   <match>
    <key type="1">xxxxxx</key>
   </match>
  <match>
    <key type="2">zzzzzz</key>
   </match>
  </matches>
</my_matches>

Thanks much.
 
><xsl:value-of select="//my_matches"/>
[tt]<xsl:copy-of select="//my_matches"/>[/tt]
 
Thank you, tsuji! That's exactly what I needed except the element includes the namespaces...is there a way to suppress that so it's just the element <my_matches>?
Code:
<my_matches xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]
 
No, except rewrite the xml. Those namespace declarations have no effect if they are not used in the descendant, or that they would reappear if they are used. The messages are intact with them appearing there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top