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

Re: copying part of XML file, but with modification

Subject: Re: copying part of XML file, but with modification
From: Jehanzeb Hameed <jehanzebhameed@xxxxxxxxx>
Date: Mon, 4 Apr 2005 00:19:32 -0700 (PDT)
jehanzeb
Thanks....That was exactly what I was looking for.

'A' wont be the document elements, and will be be a
normal kind of element. And it wont have nested
descendants :).

Jehanzeb

--- Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> wrote:
> >>>>> "Jehanzeb" == Jehanzeb Hameed
> <jehanzebhameed@xxxxxxxxx> writes:
> 
>     Jehanzeb> Hello I am trying to use xslt to copy
> a modified version
>     Jehanzeb> of a xml file. Given a node A, I want
> to generate a new
>     Jehanzeb> XML file, which is exactly the same as
> old XML file, but
> 
> OK. So it's a variation on the identity transform.
> 
>     Jehanzeb> with node A, now also the sibling of
> its parent.
> 
> So in addition to the standard identity transform,
> you want a template
> that matches all nodes that have an A child.
> 
> Note that if A is the document element, then the
> result will not be a
> well-formed XML document. 
> 
> e.g. the tree:
> 
>            /
>            |
>            A
>           / \
>           B  C
> 
> Cannot be transformed into anything sensible - the
> document node cannot
> have a sibling. I presume you want to limit A to
> being a child of an
> element. 
> 
> In which case you want a template something like:
> 
> <xsl:template match="*[child::A]">
>   <xsl:copy-of select="."/>
>   <xsl:copy-of select="A"/>
> </xsl:template>
> 
> Is A also to be only an element, or can it be some
> other kind of node?
> 
> If you can have A's nested as descendants of A's,
> then it will be more complicated.
> -- 
> Colin Paul Adams
> Preston Lancashire
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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.