XML Source fails to generate XSD
Hi guys, I have a weird XMl file that needs to be materialized into a table. The problem is I can't get the XSD file generated, it fails giving the following error: "The 'http://www.w3.org/XML/1998/namespace:id' attribute is not declared." I am no XML expert and frankly speaking this is the very first time I am working with one, but I am suspicious there is something wrong with the structure of the file I am trying to load:  <?xml version="1.0" encoding="UTF-8"?> <pbs:root xmlns:pbs="http://schema.pbs.gov.au" xmlns:g2g="http://schema.pbs.gov.au/Agency" xmlns:rwt="http://schema.pbs.gov.au/RWT/" xml:id="http://www.w3.org/TR/xml-id" xmlns:rwti="http://schema.pbs.gov.au/RWT/Increase#" xmlns:change="http://schema.pbs.gov.au/Change" xmlns:contrib="http://schema.pbs.gov.au/Contribution#" xmlns:admin="http://schema.pbs.gov.au/Administration#" xmlns:auth="http://schema.pbs.gov.au/Authority/Method#" xmlns:form="http://schema.pbs.gov.au/Form#" xmlns:incentive="http://schema.pbs.gov.au/Incentive#" xmlns:fee="http://schema.pbs.gov.au/Fee#" xmlns:markup="http://schema.pbs.gov.au/Markup#" xmlns:copay="http://schema.pbs.gov.au/Copayment#" xmlns:sn="http://schema.pbs.gov.au/SafetyNet#" xmlns:group="http://schema.pbs.gov.au/Group#" xmlns:container="http://schema.pbs.gov.au/Container#" xmlns:dr="http://schema.pbs.gov.au/DR/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:atc="http://www.whocc.no/ATC#" xmlns:dbk="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" version="2.8" vocab-version="2012-02-27"><!-- Build 2012-09-05-01 --><pbs:info> <dbk:title>Schedule of Pharmaceutical Benefits</dbk:title> <dct:created>2012-09-05</dct:created> <dct:available>2012-08-27</dct:available> <dct:issued>2012-09-03</dct:issued> <dct:valid>2012-09-03</dct:valid> <dc:publisher>Department of Health and Ageing, http://www.health.gov.au/</dc:publisher> <dc:rights>Copyright (c) 2012 Department of Health and Ageing, Commonwealth of Australia</dc:rights> <dc:rights>Permission is granted to use and redistribute this document, as long as all copyright statements are retained. Permission is not granted to modify this document.</dc:rights> </pbs:info> <pbs:changes-list xml:id="a5025736"> <pbs:change xml:id="a6460649"> <pbs:note> <dbk:para>Legacy PBDS / ACTION SHEETS / PBDS/10649</dbk:para> </pbs:note> <pbs:addition xml:id="a6390230"> <pbs:any-reference xlink:href="#a5029205"/> </pbs:addition> </pbs:change> <pbs:change xml:id="a6460653"> <pbs:note> <dbk:para>Legacy PBDS / ACTION SHEETS / PBDS/11540</dbk:para> </pbs:note> <pbs:addition xml:id="a6390242"> <pbs:any-reference xlink:href="#a5028213"/> </pbs:addition> </pbs:change> <pbs:change xml:id="a6460657"> <pbs:note> <dbk:para>Legacy PBDS / ACTION SHEETS / PBDS/14750</dbk:para> </pbs:note> <pbs:addition xml:id="a6431966"> <pbs:any-reference xlink:href="#a5142693"/> </pbs:addition> </pbs:change> ....... Any help would be highly appreciated.http://thebipalace.wordpress.com
September 23rd, 2012 11:24pm

I think the problem is in name spaces in your xml content. you can use XML Task with XSLT operation to flatten your xml data and then use xml source to extract it and pass it to any destination you want. this is an example of simplifying an xml data with XML Task and XSLT operation: http://www.rad.pasfu.com/index.php?/archives/21-XML-Task-Changing-Style-of-Data-XSLT.htmlhttp://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2012 11:30pm

when you have too many namespace used in the XML file, ssis cannot read the file as single file, either you have to treat each of the section with different namespace a s separate message OR remove all the namespace as mentioned by above. You can use the xslt operation providing the detail from the link:http://blog.hoegaerden.be/2012/06/11/removing-namespaces-through-xslt/ regards joon
September 24th, 2012 4:21am

Hi Saeed, XML document you have pasted above is not well-formed. XML data must meet the following criteria to be considered well-formed: Have a root element Have corresponding closing tags to every tag (e.g. <;address></address>) Have tags properly nested. Have all attributes enclosed in quotes. Try to make it well-formed and then you can try generating XML schema(XSD) using various tools available on net(refer below link)/visual studio http://www.xmlforasp.net/codebank/system_xml_schema/buildschema/buildxmlschema.aspx - Refer to automatically generate schema for XML document. http://sathyadb.blogspot.in/2012/09/xqueryxpathxmlschemaxml-index_6.html - Refer for information on XML schema in SQL Server. Regards, Sathya http://sathyadb.blogspot.in/ sathyas
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2012 5:04am

Hi Saeed, XML document you have pasted above is not well-formed. XML data must meet the following criteria to be considered well-formed: Have a root element Have corresponding closing tags to every tag (e.g. <;address></address>) Have tags properly nested. Have all attributes enclosed in quotes. Try to make it well-formed and then you can try generating XML schema using tools available on net/visual studio http://www.xmlforasp.net/codebank/system_xml_schema/buildschema/buildxmlschema.aspx Regards, Sathya http://sathyadb.blogspot.in/ sathyas
September 24th, 2012 5:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics