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 (1123)
+ Stylus Studio Technical Forum (13809)
+ Website Feedback (243)
- XSLT Help and Discussion (7447)
-> + Can't use (or see) XSLT or WYS... (3)
-> + Delete the xsi:nil attribute ... (2)
-> + FOTY0012: Cannot get the typed... (5)
-> + XSLT Mapper - Two way xslt map... (2)
-> + EDI (5)
-> + XSL Test for lack of XML eleme... (4)
-> + Trouble Calling a java functio... (4)
-> + How to generate EDI 997 (2)
-> + followup on tokenize with /r (5)
-> + tokenize a string with \r (4)
-> + How to convert XML to XLS file... (2)
-> - How to convert XML to XLS file... (1)
-> + how to pass value to xsl for t... (3)
-> + entity expansion liimit exceed... (4)
-> + Creating XSLT Stylesheet (2)
-> + Create XSLT from XSD (2)
-> + How to remove nodes from xml b... (4)
-> + Highlighting text in XSL file (4)
-> - XSLT to Excel, predefine cell ... (1)
-> + CSaxon8Driver issue...time out (2)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (1861)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (361)
+ 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
Clyde KesselSubject: Map element to element, but only for instance with a particular attribute value?
Author: Clyde Kessel
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
Clyde KesselSubject: RE: Map element to element, but only for instance with a particular attributevalue?
Author: Clyde Kessel
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-2011 All Rights Reserved.