J
Jorge
Hi
I'm having problems to format a Word document in XML: it seems that I cannot
freely decide where the elements of the XML Schema the document is attached
to start and end.
This is the XML Schema that I built and that is attached to the Word document:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Jorge
(None) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="tree">
<xs:complexType>
<xs:sequence>
<xs:element ref="branch" minOccurs="1" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="branch">
<xs:complexType>
<xs:sequence>
<xs:element name="leaf" type="xs:string" minOccurs="1"
maxOccurs="unbounded">
</xs:element>
<xs:element ref="branch" minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
These are the contents of my document:
text text<line break>
texttext text text<line break>
<line break>
text texttext text text<line break>
<line break>
text<line break>
I first applied the XML element "tree" to the whole text and it worked fine.
Then I tried to add the XML element "branch" to the first 3 lines and the
first 4 characters of the 4th line:
text text<line break>
texttext text text<line break>
<line break>
text
It didn't allow me to do this. Instead it just included the first 3 lines
and forgot about the 4 characters of the 4th line.
If I replace the line breaks for "soft line breaks", it works fine.
I guess there could be a conflict with WordML or something.
Thanks in advance.
I'm having problems to format a Word document in XML: it seems that I cannot
freely decide where the elements of the XML Schema the document is attached
to start and end.
This is the XML Schema that I built and that is attached to the Word document:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Jorge
(None) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="tree">
<xs:complexType>
<xs:sequence>
<xs:element ref="branch" minOccurs="1" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="branch">
<xs:complexType>
<xs:sequence>
<xs:element name="leaf" type="xs:string" minOccurs="1"
maxOccurs="unbounded">
</xs:element>
<xs:element ref="branch" minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
These are the contents of my document:
text text<line break>
texttext text text<line break>
<line break>
text texttext text text<line break>
<line break>
text<line break>
I first applied the XML element "tree" to the whole text and it worked fine.
Then I tried to add the XML element "branch" to the first 3 lines and the
first 4 characters of the 4th line:
text text<line break>
texttext text text<line break>
<line break>
text
It didn't allow me to do this. Instead it just included the first 3 lines
and forgot about the 4 characters of the 4th line.
If I replace the line breaks for "soft line breaks", it works fine.
I guess there could be a conflict with WordML or something.
Thanks in advance.