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 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Jon RobertsSubject: datadirect coverter result differs from Stylus Studio
Author: Jon Roberts
Date: 01 Aug 2008 07:18 AM
I have been using Stylus Studio to convert EDIFACT messages into XML. I open the file using the converter (converter:EDI:chr=REPLACE:invalid=TAB) and then apply an XSL transform to give me a resulting XML file I can import into my database.

All has been working well, but now I have just bought the DataDirect XML converters for dot.net to automate the process.

If I take the same EDIFACT EDI file that works in Stylus Studio and apply the following code:

factory = New ConverterFactory()
toXml = factory.CreateConvertToXml("converter:EDI:chr=REPLACE:invalid=TAB")
toXml.Convert(New UriSource(FileName), New UriResult(XMLFileName))

When I then try to use the resulting XML file as the source from my XSL in Stylus Studio, I get the following message:

Error Reported by XML Parser: Document Root Element is Missing

When I jump to location, it is the first line of the file, which is:

<?xml version="1.0" encoding="utf-8"?>
<EDIFACT>

I believe there is a rogue character at the end of the first line because if I delete this whitespace in stylus studio & recreate it (new line) then save and re-apply the XSL, then all works OK.

Any idea how I can resolve this?

Cheers
Jon

Postnext
Ivan PedruzziSubject: datadirect coverter result differs from Stylus Studio
Author: Ivan Pedruzzi
Date: 01 Aug 2008 03:05 PM

Hi Jon,

Could you please send us a sample of your EDIFACT at
stylus-field-report@progress.com?

Thanks
Ivan Pedruzzi
Stylus Studio Team

Postnext
Jon RobertsSubject: datadirect coverter result differs from Stylus Studio
Author: Jon Roberts
Date: 02 Aug 2008 05:27 AM
Hi Ivan,

Since posting this message, I have been able to raise a support query with DataDirect. I am happy to send you full details of the error too, if you'd like to see it - otherwise I'll post back as & when I get an answer from them.

Thanks
Jon

Posttop
Jon RobertsSubject: datadirect coverter result differs from Stylus Studio
Author: Jon Roberts
Date: 06 Aug 2008 04:29 AM
Problem solved. Here's advice from DataDirect Support:

///
What's probably happening is that the extra white space that the .Net serializer is emitting is getting included in the value of the elements.

There are two solutions:

1. [Harder] Change all of the [x = 'y'] predicates to be something like [normalize-space(x) = 'y'].

2. [Easier] Add decode=no and field=no to the EDI URI specification.
These will turn off the addition of comments in the EDI, and as a side-effect will suppress indentation. This will make the EDI smaller also and will speed up the transform.
///

I solved problem by changeing coverter to:
“EDI:chr=REPLACE:invalid=TAB:decode=no:field=no”

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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.