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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.