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 (1182)
- Stylus Studio Technical Forum (14569)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-> + Problem with SAXO processor - ... (5)
-> + PDF Format Help (4)
-> + License check unreliable (2)
-> - XML related issue (1)
-> + Need help regarding pipeline o... (2)
-> + Error converting XML to EDIFAC... (4)
-> + XSLT Profiling for XSLT 1.0 s... (2)
-> + Grouping (2)
-> + Best Practice for Pipeline err... (2)
-> + pdf generation (4)
-> + Problems excuting a Pipeline w... (2)
-> + XML serializer (3)
-> + Supported EDIFACT versions (5)
-> - Anyone know XActimate ESX file... (1)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (247)
+ XSLT Help and Discussion (7617)
+ XQuery Help and Discussion (1966)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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”

   
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.