Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XML schema

Former Member
0 Likes
586

Hi all,

I use XML Library for create the XML file. I have the XML schema for this document. Could you tell me how can I declare this XML schema?

Thanks a lot.

Best regards,

Igor.

4 REPLIES 4
Read only

ttrapp
SAP Mentor
SAP Mentor
0 Likes
470

Hi Igor,

sorry but I didn't get it. Do you want to validate against your schema? Or do you want a sample document for that schema (I think you mean W3C XML schema)?

Can you describe further details of your problem? And what kind of BASIS release you are using? iXML 4.6C differs slightly from 6.10 and above.

Regards

Tobias

Read only

Former Member
0 Likes
470

Hi,

I thought you could only validate against DTDs and XML Schema is not supported (yet)?

Regards, Joerg

Read only

0 Likes
470

Yes, that's right. And if you are using 4.6C Kernel even validating against a DTD won't work.

Regards

Tobias

Read only

Former Member
0 Likes
470

Hi,

So I was right. If you're able to "convert" your XML Schema to an equivalent DTD using it isn't that hard.

When you've initialized your XML parser (IF_IXML_PARSER) you just have to turn on validation by calling <i>set_validating( mode = if_ixml_parser=>co_validate )</i>. When you parse the XML document with the <i>parse( )</i> method you will receive a result <> 0 in case of errors. You can further process these errors using the <i>num_errors( ... )</i> and/or <i>get_error( ... )</i> methods.

Hope this helps (please reward me if it does),

Joerg