[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: (consistency in select results?) converting attrib

Subject: RE: (consistency in select results?) converting attributes to nested tags recursively
From: Edward.Middleton@xxxxxxxxxxx
Date: Fri, 8 Feb 2002 11:48:46 +0900
RE:  (consistency in select results?) converting attrib
Thanks for your help this is mostly what I was looking for but I was hoping to do it in a way that used
Template matches for the nodes for the following reasons.

1.	I want to be able to override the way the tag is created for particular attributes, but also have
	a default behavior for others.

	i.e. I might want to produce

	<attrib1 value="fds">
	
	rather then
	
	<tag name="attrib1" value="fds/>

2. 	The attrib2 could also be on TagB and in this case would have the same behavior 


	i.e.
	<tagA attribreq="attribreqvalue1" attrib1="fds" attrib2="hdg">
	  <TagB attrib2="hdg">Text1</TagB>
	  <tagA attribreq="attribreqvalue1" attrib1="fds" attrib2="hdg" />
	</tagA>

	would produce

	<attribreq attrib="attribreqvalue1">
	     <tag name="attrib1" value="fds">
              <tag name="attrib2" value="hdg">
                 	<TagB>
			    <tag name="attrib2" value="hdg">Text1</tag>
			</TagB>
                 </tag>
       	</tag>
	</attribreq>
	<attribreq attrib="attribreqvalue1">
       	<tag name="attrib1" value="fds">
             		<tag name="attrib2" value="hdg"/>
		</tag>
	</attribreq>



>Hmm... OK, one thing that you should be aware of is that attribute
>order is not retained in an XPath node tree. So the fact that attrib1
>comes before attrib2 in the tagA start tag in your example doesn't
>mean that the attrib1 attribute node comes before the attrib2
>attribute node in the XPath node tree. I'll assume that you don't care
>about the ordering in which the tag elements are nested inside each
>other, as it makes things simpler.
I understand this but for consecutive matches will the order be the same. i.e. if

	@* produces @c @a @b will it always produce @c @a @b or can the 
	search order change.

If this is the case I could create a sequence in each match template to determine if it was the last
attribute.

Thanks again for you help.

Edward

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.