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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make xslt handle custom tag (w/ namespace?)

Status
Not open for further replies.

mike2228

Programmer
Dec 13, 2010
5
US
I have an xslt that correctly processing :
<?xml version="1.0"?>
<aaamylist>
<aaasomenode>x</aaasomenode>
<aaasomenode>y</aaasomenode>
<aaasomenode>z</aaasomenode>
</aaamylist>

BUT, the "real" file of data has colons in the tags, like this:
<?xml version="1.0"?>
<aaa:mylist>
<aaa:somenode>x</aaa:somenode>
<aaa:someother>y</aaa:someother>
<aaa:another>z</aaa:another>
</aaa:mylist>

I then want an XSLT like this:
<xsl:stylesheet xmlns:xsl=" version="1.0"
><xsl:eek:utput method="text" /><xsl:template match="//aaa:mylist"><xsl:value-of
select="@aaa:someother" /></xsl:template>
</xsl:stylesheet>

How could I get my xslt to properly recognize //aaa:mylist and process N number of records in the xml file? If you can, please include sample code.

Thank you in advance!
 
If your XML document really looks like that, it is not well formed.

In particular, you are probably omitting that it has a namespace declaration. It would look like [tt]xmlns:aaa="some string"[/tt]

Tom Morrison
Micro Focus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top