Page 1 of 1
xml error (wrong element sequence) not reported in Oxygen 13
Posted: Wed Feb 06, 2013 10:11 am
by arhebis
Oxygen 13 did not parse a serious xml error!
I have an element with its children defined as a sequence:
<!ELEMENT ld-le ( le-begriff, le-eintrag ) >
in the actual xml file the structure was wrong:
<ld-le>
<le-eintrag>...content ...</le-eintrag>
<le-begriff>...cotent ...</le-begriff>
</ld-le>
and Oxygen reported the file as being valid! I used another parser (Eclipse) to parse the file and that one showed the error very clearly.
Thanks for your help,
Gabriela
Re: xml error (wrong element sequence) not reported in Oxygen 13
Posted: Wed Feb 06, 2013 10:26 am
by adrian
Hi,
I'm not sure how you use that and not get an error. Do you have a separate DTD? Is the DTD referred in the XML file DOCTYPE?
Can you show me an example in context?
I've tried with this sample:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ld-le [
<!ELEMENT ld-le ( le-begriff, le-eintrag ) >
<!ELEMENT le-begriff (#PCDATA) >
<!ELEMENT le-eintrag (#PCDATA) >
]>
<ld-le>
<le-eintrag>...content ...</le-eintrag>
<le-begriff>...cotent ...</le-begriff>
</ld-le>
And Oxygen (actually Xerces) correctly reports:
Code: Select all
E [Xerces] Unexpected element "le-eintrag". The content of the parent element type must match "(le-begriff,le-eintrag)".
Regards,
Adrian
Re: xml error (wrong element sequence) not reported in Oxygen 13
Posted: Wed Feb 06, 2013 10:35 am
by arhebis
In what version of Oxy did you try? I'm pretty sure I use it correctly, i have parsed thousands of xml files so far
14 reports this error, 13 does not.
the dtd is declared correctly (it stands in the folder near the xml file), any other error is reported correctly.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE projekt SYSTEM "hoca.dtd" >
....
<liste_definition>
<ld-le>
<le-eintrag>...</le-eintrag>
<le-begriff>...</le-begriff>
</ld-le>
</liste_definition>
Re: xml error (wrong element sequence) not reported in Oxygen 13
Posted: Wed Feb 06, 2013 11:03 am
by adrian
Hi,
I've tested that sample in v13.2 and v14.1. They both report the error.
Do you validate manually (Document -> Validate -> Validate - Ctrl+Shift+V) or do you rely on the automatic validation to report the error?
For the automatic validation, make sure it's enabled in Options > Preferences, Editor / Document Checking, Enable automatic validation.
Regards,
Adrian
Re: xml error (wrong element sequence) not reported in Oxygen 13
Posted: Wed Feb 06, 2013 12:22 pm
by arhebis
Ctrl+Shift+V
Can it have something to do with the entire dtd context?
Other missplaced elements are reported as errors, but this particular case is not. I find it completely unaxplainable, I tested it several times and still the same behaviour.
This is the xml stripped to only the necessary elements + Problem case at the end.
This is xml is interpreted as valid. But it's not.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE projekt SYSTEM "hoca.dtd" >
<projekt version="2.0">
<meta>
<meta_projekt>
<meta_title-id></meta_title-id>
<meta_autor>
<meta_autorvorname></meta_autorvorname>
<meta_autornachname></meta_autornachname>
</meta_autor>
<meta_titel></meta_titel>
<meta_untertitel></meta_untertitel>
</meta_projekt>
<meta_verlag>
<meta_verlagsname name="HOCA"/>
<meta_bearbeiter></meta_bearbeiter>
</meta_verlag>
<meta_ausgabe>
<meta_isbn></meta_isbn>
</meta_ausgabe>
<meta_dl>
<meta_dlname name="XXX" ansprech="XXX"/>
<jokereinsatz>
<blockjoker name="einschub" typ="1">
<jokerfundstelle></jokerfundstelle>
<jokererlaeuterung></jokererlaeuterung>
</blockjoker>
<blockjoker name="einschub" typ="2">
<jokerfundstelle></jokerfundstelle>
<jokererlaeuterung></jokererlaeuterung>
</blockjoker>
<blockjoker name="einschub" typ="3">
<jokerfundstelle></jokerfundstelle>
<jokererlaeuterung></jokererlaeuterung>
</blockjoker>
</jokereinsatz>
</meta_dl>
<titelei_ebook>
<meta_autor>
<meta_autorvorname></meta_autorvorname>
<meta_autornachname></meta_autornachname>
</meta_autor>
<meta_titel></meta_titel>
<meta_untertitel></meta_untertitel>
<meta_uebersetzer></meta_uebersetzer>
<meta_e-logo quelle="xxx.jpg"/>
<meta_e-impressum>
<meta_e-isbn></meta_e-isbn>
<doi/>
<urn/>
<meta_e-copyright></meta_e-copyright>
</meta_e-impressum>
<meta_e-kurztext></meta_e-kurztext>
<meta_e-bio></meta_e-bio>
</titelei_ebook>
</meta>
<werk>
<titelei>
<seite nr="1">
</seite>
<seite nr="2">
</seite>
</titelei>
<hauptteil>
<kapitel>
<u1>
<u-text>Schweden</u-text>
</u1>
<liste_definition>
<ld-le>
<le-eintrag><abs>....</abs></le-eintrag>
<le-begriff>....</le-begriff>
</ld-le>
</liste_definition>
</kapitel>
</hauptteil>
</werk>
</projekt>
Re: xml error (wrong element sequence) not reported in Oxygen 13
Posted: Wed Feb 06, 2013 12:38 pm
by adrian
Can you please also send us the DTD (hoca.dtd)?
If you want to keep this private, send it to: support AT oxygenxml DOT com.
Regards,
Adrian
Re: xml error (wrong element sequence) not reported in Oxygen 13
Posted: Wed Feb 06, 2013 12:40 pm
by arhebis
Ok, I will send it per email, as I am not allowed to give away the information.
Thanks,
Gabriela
Re: xml error (wrong element sequence) not reported in Oxygen 13
Posted: Fri Feb 08, 2013 4:37 pm
by adrian
Hi,
In case anyone else encounters this, there was indeed a bug in Oxygen that caused this problem in v13.0. However, this was resolved starting with v13.2.
Regards,
Adrian