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
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!!!

 
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.