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
R BaseleySubject: Mapping Alternatives
Author: R Baseley
Date: 25 Sep 2007 11:11 AM
I am a newbie at SS and XSLT.

I must process text that contains codes that determines on which document it will appear.
(A coded text appears on standard document A)
(H codded text appears on standard document H)

I have this XML now and can change it.
<NovusSalesOrderHeaderText>/H/ 1 X 20&apos; CONTAINERS STC: </NovusSalesOrderHeaderText>
<NovusSalesOrderHeaderText>/A/ 1 X 20&apos; CONTAINERS STC: </NovusSalesOrderHeaderText>
<NovusSalesOrderHeaderText>/H/ 16 PALLETS X 40 BAGS X 25KGS OR </NovusSalesOrderHeaderText>
<NovusSalesOrderHeaderText>/A/ 16 PALLETS X 40 BAGS X 25KGS OR </NovusSalesOrderHeaderText>

I wonder which way is easier to handle the text to do mapping all text that has the same code to a single text field? 1 or 2 below?

1. With code as attribute?
<NovusSalesOrderHeaderText code='H'>1 X 20&apos; CONTAINERS STC: </NovusSalesOrderHeaderText>
<NovusSalesOrderHeaderText code='A'>1 X 20&apos; CONTAINERS STC: </NovusSalesOrderHeaderText>

2. With code as node?
<NovusSalesOrderHeaderText>
<H>1 X 20&apos; CONTAINERS STC: </H>
<A>1 X 20&apos; CONTAINERS STC: </A>
</NovusSalesOrderHeaderText>

Thanks for all help.

Posttop
Alberto MassariSubject: Mapping Alternatives
Author: Alberto Massari
Date: 25 Sep 2007 02:44 PM
Both layouts are correct; in one case you can select them via an attribute value, in the other using the element name. The XSLT code used to manipulate them should have pretty much the same complexity.
In the end it's just a matter of personal taste which one you pick.

Hope this helps,
Alberto

 
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.