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)
-> + DBF converter with the Cyrilli... (3)
-> + Stylus Studio caching document... (3)
-> + Stylus Studio Online help inst... (9)
-> + specific colors (2)
-> + Formatting problems when creat... (2)
-> - Headers and Footers (1)
-> + XML output's a URL in Browser ... (2)
-> + Generating Java Code for XML (3)
-> + format dates in publisher (2)
-> + grouping in Stylus Studio Publ... (5)
-> + Can schema documentation title... (3)
-> + Stylus can not find the right ... (2)
-> + Problem to create Schema from ... (5)
-> - Design a DTD to represent the ... (1)
-> + Surround SCM integration (3)
-> + Converting a csv file to xml u... (5)
-> + Legacy Format Handling (3)
-> + Size limit for XML documents (2)
-> + Can Stylus Studio easily expor... (3)
-> + Problem convert excel to xml (5)
-> + convert X12 EDI into XML in a... (2)
-> + Capturing the return data for ... (3)
-> + stamps.com wsdl issues (3)
-> + Preview issues (2)
-> + Stylus Studio X14 - XML to EDI... (3)
-> + Stylus Studio X14 - Overrides ... (4)
-> + Anyway to specify namespace pr... (6)
-> + StylusStudio 2010 crashes when... (6)
-> + Version Upgrade (2)
-> + How to write a if -else statem... (4)
-> + URGENT URGENT URGENT ! (EDIF... (3)
-> + X14 Saxon document uri problem (5)
-> + namespace problem on XML gener... (7)
-> + Stylus Studio Tool Bars (2)
-> + X14 Enterprise - Web Services ... (3)
-> + Saxon edition in X14 Enterpris... (2)
-> + How to create PDF documents wi... (2)
-> + WSCall doesn't work from xquer... (4)
-> + Issues with converter (8)
-> + xsd null strings - option to i... (2)
-> + wrapping table rows and mismat... (3)
-> + Report Designer: Is it possibl... (4)
-> + Message Baplie 1.5 with 1.911 ... (2)
-> + saved merged view in diff engi... (2)
-> + Cannot see needed element to m... (2)
-> + Matching problem in function (3)
-> - Funny warning message (1)
-> - Missing rows and text when con... (1)
-> + Another JSON problem (2)
-> + JSON problem (8)
-> + WebDav Custom properties (2)
-> + jvm not registering in the too... (2)
-> + How to turn off error about mi... (6)
-> + XML Attribute Element output f... (2)
-> + ddtek:wscall not returning all... (7)
-> - Trial Only Lasted 7 of the 14 ... (1)
-> + tree view without leaves (fiel... (3)
-> + XML to Text File (2)
-> + Stylus Studio Processor Debugg... (3)
-> + Java XMLPipeline result to str... (6)
-> + Attribute - XSD, DataDirect, X... (7)
-> + .NET XslCompliedTransform pro... (3)
-> + How to increase JVM Heap Size? (10)
-> + How in XSD do I reference the ... (2)
-> + Conversion of negative numbers (2)
-> + XSLT mapper (2)
-> - Converting csv file with embed... (1)
-> + WSDL completion inquiry (2)
-> - Move License (1)
-> + XML to Excel conversion and vi... (8)
-> + “spell checker” and “well-form... (2)
-> + Relational DB Icon Not appeari... (2)
-> + How come AUP doesn't respond (4)
-> - Software activation does not w... (1)
-> + Stylus studio continually cras... (2)
-> + Error running on Windows 7 (3)
-> + Creating xml start and end tag... (4)
-> + Keeping track of position afte... (3)
-> + splitting a row into multiple ... (3)
-> + Where is Convert to XML? (2)
-> + Built-In XSLT Processor Missin... (4)
-> - Converting XSL to XSL-FO (1)
-> - Can we compare two XML Schema ... (1)
-> - Stylus Studio EDI Conversion /... (1)
-> + Installation Issue Windows XP ... (2)
-> + Converting CSV with component ... (2)
-> - how to edit a xsl file, so tha... (1)
-> - Cannot save file to Webdav (1)
-> + How to copy Column Names on Gr... (3)
-> - XML when to use (1)
-> - Attribute vs data elements (1)
-> - Attribute Group (1)
-> - EDI conversion from command li... (1)
-> - WSDL schema - import of xsd (1)
-> + Get Date (2)
-> + help calling https web service (5)
-> - Newbie looking out for BizTalk... (1)
-> + Publishing XML pipeline as Web... (2)
-> - annotation within sequence ele... (1)
-> - backmapping using Saxonica 9.1... (1)
-- Previous [301-320] [321-340] [341-360] 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
dean katzSubject: How to create SQL/XML
Author: dean katz
Date: 03 Aug 2005 06:17 PM
I am very new to XML, XSD as well as stylus studio. I have a table that was created using MSAccess 2002. This table is already upsized to our SQL server. I now have to transfer the contents of this table to an outside party but before I do that they want me to validate the records in the table against the schema created by them. Some of the fields in my table is defined as elements in the schema but there a few which are defined as attributes. How do I even begin to aproach the task of transfering from a table format to XML format that matches the consultant's schema?

sample:
table 'clients' has these fields
record_id
add_date
edit_date
lname
fname
gender
dob

according to the schema record_id, add_date and edit_date are attributes
whereas lname, fname, gender and dob are elements.

how do I create the SQL/XML that will get record_id, add_date and edit_date as attributes and lname, fname, gender and dob as elements? please help.

Postnext
Tony LavinioSubject: How to create SQL/XML
Author: Tony Lavinio
Date: 03 Aug 2005 10:58 PM
Here is a step-by-step video tutorial on how to do exactly that. http://www.stylusstudio.com/videos/dbtoxml1/dbtoxml1.html

Postnext
dean katzSubject: How to create SQL/XML
Author: dean katz
Date: 04 Aug 2005 11:21 AM
Thank you for the pointer. I started on that page to create an SQL/XML query below. But somehow kept getting an error message. What is wrong with my SELECT statement? Thank you in advance for your help.

SELECT
XMLELEMENT(name "row",
XMLATTRIBUTES("record_id",t.record_id),
XMLATTRIBUTES("system_id",t.system_id),
XMLATTRIBUTES("odbid",t.odbid),
XMLATTRIBUTES("date_added",t.date_added),
XMLATTRIBUTES("date_updated",t.date_updated),
XMLELEMENT(name "first_name",t.first_name),
XMLELEMENT(name "last_name",t.last_name),
XMLELEMENT(name "mi_initial",t.mi_initial),
XMLELEMENT(name "soc_sec_no",t.soc_sec_no),
XMLELEMENT(name "ethnic",t.ethnic),
XMLELEMENT(name "gender",t.gender),
XMLELEMENT(name "dob",t.dob)
)
FROM SPSQL.dbo.clients t

Postnext
Ivan PedruzziSubject: How to create SQL/XML
Author: Ivan Pedruzzi
Date: 04 Aug 2005 12:03 PM
XMLATTRIBUTES has a different syntax from XMLELEMENT. Change your query to

SELECT
XMLELEMENT(name "row",
XMLATTRIBUTES(t.record_id, t.system_id, t.odbid, t.date_added, t.date_updated),
XMLELEMENT(name "first_name",t.first_name),
XMLELEMENT(name "last_name",t.last_name),
XMLELEMENT(name "mi_initial",t.mi_initial),
XMLELEMENT(name "soc_sec_no",t.soc_sec_no),
XMLELEMENT(name "ethnic",t.ethnic),
XMLELEMENT(name "gender",t.gender),
XMLELEMENT(name "dob",t.dob)
)
FROM SPSQL.dbo.clients t


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
dean katzSubject: How to create SQL/XML
Author: dean katz
Date: 04 Aug 2005 12:10 PM
aaaaah. i c. thank you!

Postnext
dean katzSubject: How to create SQL/XML
Author: dean katz
Date: 24 Aug 2005 06:08 PM
Originally Posted: 04 Aug 2005 02:12 PM
Here's more question...<br> <br> The schema that am using to validate my XML document have an element called dynamic_content. This element holds info about gender, birthdate, weight, height etc. I don't have a field in my table that corresponds to this dynamic_content element. But I have fields on my table that carries info on gender and birthdate. How should I change the SQL/XML syntax to include the gender and birthdate field and still stick to the schema? GOd, I really hope I am making sense. Felt like I am learning to swim as I was drowning!

Postnext
Ivan PedruzziSubject: How to create SQL/XML
Author: Ivan Pedruzzi
Date: 04 Aug 2005 06:30 PM
Create the dynamic_content elemen and then bind the columns you like as children


SELECT
XMLELEMENT(name "row",
XMLATTRIBUTES(t.record_id, t.system_id, t.odbid, t.date_added, t.date_updated),
XMLELEMENT(name "first_name",t.first_name),
XMLELEMENT(name "last_name",t.last_name),
XMLELEMENT(name "mi_initial",t.mi_initial),
XMLELEMENT(name "soc_sec_no",t.soc_sec_no),
XMLELEMENT(name "ethnic",t.ethnic),

XMLELEMENT(name "dynamic_content"
XMLELEMENT(name "gender",t.gender),
XMLELEMENT(name "birthdate",t.birthdate)),

XMLELEMENT(name "dob",t.dob)
)
FROM SPSQL.dbo.clients t

Postnext
dean katzSubject: How to create SQL/XML
Author: dean katz
Date: 24 Aug 2005 06:07 PM
another question:
i have a table 'clubs' with these fields: club_id, clubname, clubtype, yearform.

i also have another table that list the members of each club. members table have these fields: member_id, member_name, date_join, member_rank, and member_position. in the schema, members is listed as element of clubs. how would I craft the SQL/XML ststement to include all element inside clubs and members. is it possible to create a SELECT statement within another Select statement like in t-sql like this:

SELECT
XMLELEMENT(name "clubs,
XMLELEMENT(name "club_id", t.club_id),
XMLELEMENT(name "club_name", t.club_name),
SELECT
XMLELEMENT(name "members",
XMLELEMENT(name "member_name", t.member_name),
XMLELEMENT(name "member_id", t.memberid),
XMLELEMENT(name "date_join", t.date_join)
))
FROM ClubDB.dbo.tblmembers

)
FROM ClubDB.dbo.tblclubs

I get an incorrect syntax when I try to run this. Please help.

Posttop
Ivan PedruzziSubject: How to create SQL/XML
Author: Ivan Pedruzzi
Date: 24 Aug 2005 11:01 PM
The question has been already answered, see the following post

http://www.stylusstudio.com/SSDN/default.asp?action=9&read=3742&fid=46#10720


Ivan Pedruzzi
Stylus Studio Team

   
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.