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 (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + 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)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Mary VallesSubject: Attribute - XSD, DataDirect, XQuery and XML output
Author: Mary Valles
Date: 04 Aug 2011 01:22 PM
I am new to Stylus and XML and really need help.

I have a project that contains a XQuery (mapped to SQL Server data) and an XSD file.

I have attached the following sample files:
Test.xsd
Test - current.xml
Test - Desired.xml


I need to have each attribute value in a seperate XML record versus all together.


DocumentTest-Desired.txt


DocumentTest-current.xml


Documenttest(6).xsd

Postnext
Ivan PedruzziSubject: Attribute - XSD, DataDirect, XQuery and XML output
Author: Ivan Pedruzzi
Date: 04 Aug 2011 02:20 PM
Hi Mary,

My guess is that the query does not iterate through the repeating element.
We need to see the XQuery code in order to help.

Ivan


Postnext
Mary VallesSubject: Attribute - XSD, DataDirect, XQuery and XML output
Author: Mary Valles
Date: 04 Aug 2011 02:51 PM
Can I e-mail the code and files to you?

Postnext
Mary VallesSubject: Attribute - XSD, DataDirect, XQuery and XML output
Author: Mary Valles
Date: 04 Aug 2011 02:57 PM
I have attached the actual XQuery and XSD files. If you need to see the XML output please let me know.


DocumentMEVXQuery.xquery


DocumentMEV.xsd

Postnext
Ivan PedruzziSubject: Attribute - XSD, DataDirect, XQuery and XML output
Author: Ivan Pedruzzi
Date: 04 Aug 2011 03:40 PM
May,

I can see several problems

What you are trying to accomplish with the following? Do you need to generate a Transactional or a DTOApplication element for each record in the XML_Application?

for $_x0058_ML_Application in collection("MSRB_Test_be.dbo.XML_Application")/_x0058_ML_Application/AppModID
return
<Transactional>
{
for $_x0058_ML_Application2 in collection("MSRB_Test_be.dbo.XML_Application")/_x0058_ML_Application/ApplicationNumber
return



In regards of the duplicate attribute values, see the following changes

for $_x0058_ML_Application2 in collection("MSRB_Test_be.dbo.XML_Application")/_x0058_ML_Application
return
<DTOApplication
ApplicationNumber="{ $_x0058_ML_Application2/ApplicationNumber}"
CustomerRef="{$_x0058_ML_Application2/CustomerRef}"
Description="{$_x0058_ML_Application2/Description}"

... and several others


Every time you see a call to the collection function inside an attribute value you should be suspicious.



The following where statement also sounds suspicious, it should express a relationship between the tables XML_Building and XML_Line

for $_x0058_ML_Building in collection("MSRB_Test_be.dbo.XML_Building")/_x0058_ML_Building
where collection("MSRB_Test_be.dbo.XML_Line")/_x0058_ML_Line




Hope this helps
Ivan

Postnext
Mary VallesSubject: Attribute - XSD, DataDirect, XQuery and XML output
Author: Mary Valles
Date: 04 Aug 2011 04:02 PM
Yes, the objective is a single Transactional element for each record returned in XML_Application.

Thanks so much for you help. I will look at the items you pointed out snd see how far I get.

I may be back asking for more help! :)

Posttop
Mary VallesSubject: Attribute - XSD, DataDirect, XQuery and XML output
Author: Mary Valles
Date: 04 Aug 2011 06:43 PM
Thanks so much Ivan...you saved my life!!!

   
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.