Error if an element name is declared more than once in XSD. But e.g. Dot.Net accepts this
frame maker 11 reports error if element name declared more once in xsd. dot.net 4.0 validation same xsd ok such model , validates different modeled elements same name (e.g. fett) correctly. need "double declaration of same element" feature in frame maker 11 in big migration project. migrate sgml data xml. how can solve this?
hint: explicitly want prohibit endless recursive nesting of elements!
sample xsd:
<xs:schema xmlns="http://tempuri.org/test-rekursion" xmlns:tr="http://tempuri.org/test-rekursion" elementformdefault="qualified" attributeformdefault="unqualified" targetnamespace="http://tempuri.org/test-rekursion" xmlns:xs="http://www.w3.org/2001/xmlschema" > <xs:group name="inlinebase"> <xs:choice> <xs:element name="sup" type="xs:string" /> <xs:element name="sub" type="xs:string" /> <xs:element name="keyword" type="xs:string" /> <xs:element name="inline-graphics" type="xs:string" /> </xs:choice> </xs:group> <xs:element name="paragraph"> <xs:complextype mixed="true"> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:group ref="tr:inlinebase" /> <xs:element name="bold"> <xs:complextype mixed="true"> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:group ref="tr:inlinebase" /> <xs:element name="italic"> <xs:complextype mixed="true"> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:group ref="tr:inlinebase" /> </xs:choice> </xs:complextype> </xs:element> </xs:choice> </xs:complextype> </xs:element> <xs:element name="italic"> <xs:complextype mixed="true"> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:group ref="tr:inlinebase" /> <xs:element name="bold"> <xs:complextype mixed="true"> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:group ref="tr:inlinebase" /> </xs:choice> </xs:complextype> </xs:element> </xs:choice> </xs:complextype> </xs:element> </xs:choice> <xs:attribute name="autor" type="xs:string" /> </xs:complextype> </xs:element> </xs:schema>
sample xml:
<paragraph xmlns="http://tempuri.org/test-rekursion" xsi:schemalocation="http://tempuri.org/test-rekursion test-recursion2.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" > lorem ipsum <bold>dolor <italic>sit amet<sup>hoch 2</sup>, consetetur </italic>sadipscing elitr, sed diam nonumy eirmod</bold> tempor invidunt ut labore et <italic>dolore <bold>magna aliquyam<sup>hoch 3</sup> erat</bold>, sed diam voluptua</italic>. @ vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet. lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. @ vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet. </paragraph>
opening xml in frame maker 11 results in following error:
xml read report log source document: c:\work\docs\120820-base-umstrukturierung\bold-italic-test-2.xml xml parser messages (document prolog) error @ file c:\users\t25681a\appdata\local\temp\fmtccd7.tmp, line 18, char 17, message: element 'italic' has been declared error @ line 19, char 15, message: element 'bold' has been declared
thanks lot suggestions
miro
hi miro,
i'm no power user of xml schema may not able provide lot of help. 2 observations though:
- if parser used framemaker (xerces) doesn't construct, think have no choice change construct. knowledge, there nothing can alter how parser interprets files. don't know sure, if xerces says wrong, dot.net wrong not saying it's wrong
- schema provides reasonably flexible mechanism declaring (naming) <element> 1 time (e.g., <element name="fett">), referencing element throughout schema (e.g., <element ref="fett">) have tried approach, , if so, limitations made unworkable? i'm curious because think prevention of endless recursion worthy effort.
russ
More discussions in FrameMaker Structured
adobe
Comments
Post a Comment