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

Having elements defined only once with XSLT

Subject: Having elements defined only once with XSLT
From: "Janne Luoma" <janne@xxxxxxxxxxxx>
Date: Fri, 20 Nov 2009 11:37:03 +0200
 Having elements defined only once with XSLT
Hi,

I'm stuck with following XSLT processing problem:

Source XML
==========
<object id="objectA">
            <property typeName="PropA">
            	<value>Jack</value>
            </property>
</object>
<object id="objectB">
            <property typeName="PropB">
	            <value>Jim</value>
            </property>
</object>
<object id="objectC">
            <property typeName="PropC">
           	 <value>John</value>
            </property>
</object>


Now my XSLT script process the Source XML-file so that some of the
elements ('objectA', 'objectB'. 'objectC') may be resulted in the
beginning of the result file (or may not, based on the XSLT rules). That
XSLT script part + rules works fine!

But in case that element ('objectB' in my sample) is defined already in
the beginning of the result file and then the same used later in the
document, this element should be referenced by href (not generated the
full information again!). (In cases where element is not defined in the
beginning, it should be reported fully, this works fine!). So my
question is: How to know which objects / elements have been
handled/defined already in the output, so that I could use href in those
cases?


Expected output:
================
<!-- File starts -->
<object id="objectB">
             <property typeName="PropB">
  		   <name>Jim</name>
	  </property>
</object>

<!-- ...            -->
<!-- File continues -->
<!-- ...            -->

<Model>
	<object id="objectA">
		 <property typeName="PropA">
			   <name>Jack</name>
		  </property>
	</object>
           <object href="#objectB"/>
	<object id="objectC">
		 <property typeName="PropC">
	 		   <name>John</name>
		  </property>
	</object>
</Model>
<!-- File ends -->

Thanks in advance

Janne

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.