xsl-list
[Top] [All Lists]

RE: [xsl] Having elements defined only once with XSLT

2009-11-20 06:15:59
Hi,

Thank you for your help and good tip. I'm using the XSLT 2.0, and you
are right, temporary tree seems to be a very reasonable suggestion. 

Janne

Janne Luoma wrote:

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?

Do you use XSLT 2.0 or 1.0?
With 2.0 you could easily transform in a first step into a temporary
tree stored in a variable and then on the second step check the
temporary tree in the variable.
With 1.0 you would need to make use of an extension function like
exsl:node-set to do this with one transformation.


--

      Martin Honnen
      http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>