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

Re: Evaluating XML inside attributes (using XSLT 2.0 a

Subject: Re: Evaluating XML inside attributes (using XSLT 2.0 and Saxon)
From: James Fuller <james.fuller.2007@xxxxxxxxx>
Date: Wed, 24 Mar 2010 19:44:55 +0100
Re:  Evaluating XML inside attributes (using XSLT 2.0 a
ummmm ... u can get his paper here as well

http://www.xmlprague.cz/2009/presentations/XMLPrague_2009_proceedings.pdf

J


On Wed, Mar 24, 2010 at 7:39 PM, Jacobus Reyneke
<jacobusreyneke@xxxxxxxxx> wrote:
> Good day,
>
> This is in relation to my earlier posts, but I have not yet been able
> to solve my problem. I have tried working around the problem below,
> but because of the type of information I'm working with (labeling and
> vector graphics), I can't get past the fact that sometimes I end up
> with attributes that will get part of their content from other parts
> of the XML document.
>
> Can anyone please share some ideas around evaluating information for
> use inside xml attributes. I know it's ugly, horrible and terrible to
> escape XML an dump it inside an attribute, but I need to reference
> content by id from inside attributes from time to time. I can move
> attributes out into child elements, but this can become even more
> confusing.
>
> Input:
> <root>
>  <name lookup-id="5">
>    Johny
>  </information>
>  <chapter title="The life of &lt;x&gt;5&lt;/x&gt;">
>     Everyone knew that <x>5</x> was a happy child
>  </chapter>
> </root>
>
> XSLT
> ???
>
> Required output:
> <root>
>  <name lookup-id="5">Johny</information>
>  <chapter title="The life of Johny">Everyone knew that Johny was a
> happy child</chapter>
> </root>
>
> I'm unable to get the XSLT processor to evaluate the content of the
> title attribute. Obviously a template matching x does not get called
> for content inside attributes.
>
> A generic approach would be ideal. Something that will work no matter
> where <x>5</x> is.
>
> Kind regards,
> Jacobus

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.