XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
David KarrSubject: Map element to element, but only for instance with a particular attribute value?
Author: David Karr
Date: 14 Nov 2005 05:54 PM
I'm finding I know what I need to do in xslt, but I'm having trouble
visualizing how to do it graphically in the mapper. I'll try to
describe what I have so far.

I have a source and target schema, and I've set the source and target
context on each side.

In my source schema, I have an element "AdditionalOutputData" that has a
sequence of "DataAttribute" elements, which have a "name" attribute. I
know that in my source document, one of the "DataAttribute" elements
will have a "name" value of "id". I need to copy the "DataAttribute"
body in that case to the "UID" element in my target schema.

I figured the XSLT for this might look something like this:


xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="..."
xmlns:b="...">


select="b:AdditionalOutputData/b:DataAttribute[@name='id']"/>




It's the condition part that's stumping me. I don't see how I would
best represent this in the mapper canvas, so the logic is represented
graphically (as much as possible).

Postnext
(Deleted User) Subject: Map element to element, but only for instance with a particular attribute value?
Author: (Deleted User)
Date: 14 Nov 2005 09:04 PM
David,
Can you attach the two schemas?
Thanks much,
Clyde Kessel

Postnext
David KarrSubject: RE: Map element to element, but only for instance with a particular attributevalue?
Author: David Karr
Date: 14 Nov 2005 09:56 PM
Ok. I was assuming this could be answered with a general strategy, but
I'll attach them.

> -----Original Message-----
> From: stylus-studio-xslt Listmanager
> [mailto:stylus-studio-xslt.listmanager@stylusstudio.com]
> Sent: Monday, November 14, 2005 6:06 PM
> Subject: Map element to element, but only for instance with a
> particular attributevalue?
>
>
> From: "Clyde Kessel"
>
> David,
> Can you attach the two schemas?
> Thanks much,
> Clyde Kessel
>
>
> --
> To reply: mailto:stylus-studio-xslt.12572@stylusstudio.com
> To start a new topic: mailto:stylus-studio-xslt@stylusstudio.com
> To login: http://www.stylusstudio.com/SSDN/
> To (un)subscribe:
> mailto:stylus-studio-xslt.list-request@stylusstudio.com
>
>


UnknownInterConnectResponse.xsd


UnknownNACV_Response.xml

Posttop
(Deleted User) Subject: RE: Map element to element, but only for instance with a particular attributevalue?
Author: (Deleted User)
Date: 15 Nov 2005 10:45 AM
David,

As you suggested, you need to create this value-of:

<xsl:value-of select="AdditionalOutputData/DataAttribute[@name='id']"/>

Mapper has no graphical representation for predicates, so you need to first create the simple value-of

<xsl:value-of select="AdditionalOutputData/DataAttribute"/>

graphically, then edit the XSLT code in the source pane, adding the [@name='id'] attribute.

Clyde Kessel

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.