Hi All,
Good morning.
I have a xsd schema file and xml data file. I have to read the xml file data and validation should happen against the xsd file. I have 8.5 version installed on my machine.
I do not find any option in XML input stage to include the xsd file.
In XML stage, there is a change to validate the xml file with xsd.
I need your suggestion (steps) to use xml stage in reading the xml file.
Thanks in advance.
Read xml file with xsd
Moderators: chulett, rschirm, roy
Read xml file with xsd
Thanks,
Sai
Sai
-
- Participant
- Posts: 50
- Joined: Fri Aug 29, 2014 1:32 pm
- Location: Mumbai
Hi Spuli,
First you need to include the xsd as a library and then use it in XML stage in XML Parser step>Document root.
Here is the step to step explanation of same,
https://www.ibm.com/developerworks/data ... atastages/
I had a tough time getting help on XML too. I hope you will find all answers in the link.
First you need to include the xsd as a library and then use it in XML stage in XML Parser step>Document root.
Here is the step to step explanation of same,
https://www.ibm.com/developerworks/data ... atastages/
I had a tough time getting help on XML too. I hope you will find all answers in the link.
Thanks Sarath for your inputs.
I created a text file and wrote the xml file name (with complete path) in it.
This is the source stage to XML stage.
I am trying to write some nodes data into a sequential file.
Getting the below error.
XML_0,0: 2015-04-20 12:00:59,457 Warn [XML_Parser] []
Start XML Validation Errors (Only first error reported for any path in the schema):
Path: [Schema_Node]
CDIER0007E: An error occurred while reading the XML: cause=javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x5c) was found in the prolog of the document., systemId=null, line number=1, column number=1, step=XML_Parser, source=\\server\XML\test.xml.
End XML Validation Errors
Am I doing anything wrong. Please suggest.
I created a text file and wrote the xml file name (with complete path) in it.
This is the source stage to XML stage.
I am trying to write some nodes data into a sequential file.
Getting the below error.
XML_0,0: 2015-04-20 12:00:59,457 Warn [XML_Parser] []
Start XML Validation Errors (Only first error reported for any path in the schema):
Path: [Schema_Node]
CDIER0007E: An error occurred while reading the XML: cause=javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x5c) was found in the prolog of the document., systemId=null, line number=1, column number=1, step=XML_Parser, source=\\server\XML\test.xml.
End XML Validation Errors
Am I doing anything wrong. Please suggest.
Thanks,
Sai
Sai
You are probably on the right track, but be aware of the following when working with the xml (now called Hierarchical) Stage...
a) how is your xml? It is very important that you have a good understanding of xml and especially xsd's before starting with the xml stage.
b) review the dev works article above. Also be sure to look at the very good redbook for xml.
http://www.redbooks.ibm.com/redbooks/pdfs/sg247987.pdf
c) learn to "parse" and "read" xml before you try to write it. That will teach you basic concepts about working with lists and see how an xsd is represented in the Stage, before you do the more difficult "writing" of xml.
Ernie
a) how is your xml? It is very important that you have a good understanding of xml and especially xsd's before starting with the xml stage.
b) review the dev works article above. Also be sure to look at the very good redbook for xml.
http://www.redbooks.ibm.com/redbooks/pdfs/sg247987.pdf
c) learn to "parse" and "read" xml before you try to write it. That will teach you basic concepts about working with lists and see how an xsd is represented in the Stage, before you do the more difficult "writing" of xml.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 50
- Joined: Fri Aug 29, 2014 1:32 pm
- Location: Mumbai