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
steve reidSubject: Mapping xslt files - beginner having difficulty!
Author: steve reid
Date: 19 Sep 2006 10:54 AM
Hi all,
Im new to xml but quickly learning. My project is that I need to convert a csv file to xml, adhering to a schema file. Heres what I've done (thanks to another forum user for telling me how to do this!):

1.Created an adapter to convert my csv to xml
2.Created a xslt stylesheet, where the source file uses the csv file and adapter and the target file is an example xml file provided to me.

On the attached file, the only fields im having trouble with is the
PROPERTYLINEADDRESS fields on the source xml document, and the apd:line field on the target document. When I add the target document there is only 1 apd:line field - so I duplicate them.(is this ok?). The problem then is that if the field has only 2 values and the others are blank it still displays the blank line like so:

<apd:line>1 MAIN STREET</apd:line>
<apd:line>SOMETOWN</apd:line>
<apd:line />
<apd:line />

If I look at the xml file created by my adapter, if does not display these extra lines as I set it to exclude from output if blank or empty.

How do I get rid of these extra <apd:line /> lines?

Could someone point me in the right direction?

Many thanks,

Steve


Imagemapping.jpg

Postnext
Ivan PedruzziSubject: Mapping xslt files - beginner having difficulty!
Author: Ivan Pedruzzi
Date: 19 Sep 2006 11:03 AM

Use "if" blocks to drive the value links.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
steve reidSubject: Mapping xslt files - beginner having difficulty!
Author: steve reid
Date: 19 Sep 2006 11:11 AM
thanks for the speedy reply!
I'll go try them out. Have to say this prog is much better than Altovas Mapforce. Looks like Stylus is going to get my cash!

 
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.