Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Is it possible to modify a source node using XSLT?

From: Barry Andrews <titanandrews@----.--->
To: NULL
Date: 5/6/2005 12:25:00 AM
Hi,

    So the source is read only? That is good to know I suppose, although 
it seems odd to me. Anyway, let me try to explain a little more. My 
target document might look like this:

<TARGET>
    <FI name="Changed">
       <CHILD_FI name="Changed_1"/>
    </FI>
</TARGET>

Notice that CHILD_FI name is based on FI. (with _1 appended) But I 
cannot do this, because when I select the name from the parent, I get 
the old name which is A. So instead my new name would end up being A_1, 
which is not what I want.
Make sense?

many thanks,

B

David Carlisle wrote:
> "titanandrews@h..." <titanandrews@h...> writes:
> 
> 
>>Hi,
>>
>>  I have ran into a situation that I think should be possible, but I am
>>fairly new to XSLT so maybe not.
>>
>>Suppose I have the following document
>><ROOT>
>>   <FOO name="A">
>>      <CHILD name="B"/>
>>   </FOO>
>></ROOT>
>>
>>I am creating a new XML doc using XSLT, and I change the name attribute
>>of the first node FOO in my target doc. The name attribute of CHILD is
>>dependent on it's parent, i.e. it's built from the parent name. So I
>>select the parent name with XPATH "../@Name", but it returns the name
>>from the source document. I need the name from the target document,
>>because the old name is no good. How can I do this? Is it possible to
>>modify a source node in XSLT? I can modify a DOM document in a program
>>easily, so it seems like it would be possible to do in XSLT. If I can
>>do this, then the task will be easy. Are there any other ways to
>>achieve this?
>>
>>
>>Many thanks for the help!
>>
>>
>>regards,
>>
>>B
> 
> 
> XSLT input tree is read only, however as far as I understand your
> description you don't want to modify the source just generate a new
> element with some name. You haven't given any indication of what element
> name you need to generate. Also it needs to be @name not @Name, XML is
> case sensitive.
> 
> What result document do you need to generate given the above input??
> 
> David
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent