This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Match pattern should get child content but gets sib's content also


This should be present in Dave's XSLT-FAQ.
Read about default rules (templates) processing.

Cheers,
Dimitre Novatchev.

"Doug Zirbel" <doug at psiconsultants dot com> wrote:

====== Here's my simplified xml doc ========

<?xml version = "1.0" encoding = "UTF-8"?>
<?xml-stylesheet href =
'file:///C:/Documents%20and%20Settings/doug/My%20Documents/ADE3.xsl' 
type =
'text/xsl'?>

<moduleExternal xmlns:xsi =
"http://www.w3.org/2001/XMLSchema-instance";;>
	<parm>
		<link>
			<aValue>Hello</aValue>
		</link>
	</parm>
	<parm>
		<constraint>
			<aValue>OOPS</aValue>
		</constraint>
		<link>
			<aValue>World</aValue>
		</link>
	</parm>
</moduleExternal>

======== AND THE XSL file ==========
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";;>

	<xsl:template match="link/aValue">
		<xsl:value-of select="."/>
		<xsl:text> </xsl:text>
	</xsl:template>

</xsl:stylesheet>


====== I'm opening the xml file in IE6.0 and what I get is this =====

Hello OOPSWorld

=========== This may be obvious to everyone but I thought that a match
pattern of "link/aValue" would skip over the <aValue> child of
<constraint>
and get only <aValue> content that is a child of <link>.

TIA for any help with this... I've not been able to successfully wade
through all of the posts in biglist.
Best regards,
Doug Zirbel





__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]