Skip to Content
2
Former Member
Jul 25, 2007 at 07:51 AM

XSD-how to ignore comments?

209 Views

Hi experts!

I need to build a XML-file and take its structure from a XSD-scheme. I parsed it and now I need to find differrent nodes. I tried to find those using this code:

li_root = l_document->get_root_element( ).

CALL METHOD li_root->get_root

receiving

rval = lx_node2.

CALL METHOD li_root->find_from_name_ns

EXPORTING

depth = 99

name = 'annotation'

  • uri = ''

RECEIVING

rval = lx_elem.

Unfortunately this is not possible, because there are comments in the XSD-file.When I list the nodes available it gives me the first node (xs:schema) and then a second one,which is recognized as comment. But I am afraid that the program does not recognize the end of the comment and therefore does not find the nodes I need (e.g. xs:element)

Does anybody of you hava an idea how i can ignore these comments? I do not want to change the XSD with an editor or sth like that. I post the beginning of the XSD for better understanding.

Thanks in advance!

Felix

Points will be rewarded for useful answers!

<xs:schema

targetNamespace="http://www.gaeb.de/GAEB_DA_XML/200407"

xmlns:ds="http://www.w3.org/2000/09/xmldsig#"

xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns="http://www.gaeb.de/GAEB_DA_XML/200407"

elementFormDefault="qualified"

attributeFormDefault="unqualified">

<! =============================Digitale Signatur=============================================================== >

http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>

<! =============================Attribut space=============================================================== >

http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>

<! ========================================================================================================= >

<! GAEB >

<xs:element name="GAEB" type="tgGAEB"/>