all groups > dotnet xml > august 2006 >
You're in the

dotnet xml

group:

XML reading issue



XML reading issue Neelesh rawal
8/28/2006 11:54:02 PM
dotnet xml: I have some XML file like that:
<data>
<WebInfo>
<Folder></Folder>
</WebInfo>
<album>
<info></info>
</album>
</data>

if i am matching the 'album' template in a xsl means
<xsl:template match="album">
then how can access the values of upper nodes like 'webinfo'.
and
if i am going to match the 'data' node
means <xsl:template match="data"> then i m getting the error
'Token content in state PostDTD would result in an invalid xml document'

i am new in the field of xml and xslt. Any help that any body can provide
would be gratefully appreciated.
Thanks,
Re: XML reading issue Oleg Tkachenko [MVP]
8/29/2006 12:00:00 AM
[quoted text, click to view]

<xsl:value-of select="../WebInfo"/>
or
<xsl:value-of select="preceding-sibling::WebInfo"/>

XPath provides full navigation to any place in the XML tree.

[quoted text, click to view]

You must be producing bad XML output - sounds like some text is
outputted before root element is out.

--
Oleg Tkachenko [XML MVP, MCPD]
AddThis Social Bookmark Button