Hi Roger,
Thanks for sharing this trick.
Yes, the Format and Indent operation takes the schema information into
account with regard to the space preserve, mixed, or element only
properties of an element.
This support is controlled by the "Schema-aware format and indent" option.
https://www.oxygenxml.com/doc/versions/23.1/ug-editor/topics/preferences-editor-format-xml.html#preferences-editor-format-xml__schema-aware-format-indent
The schema can be associated in the file, but you can associate it also
using a validation scenario.
https://www.oxygenxml.com/doc/versions/23.1/ug-editor/topics/associate-schema-to-document.html
Best Regards,
Octavian
On 5/11/2021 7:36 PM, Roger L Costello wrote:
Hi Folks,
I have an XML Schema with a simpleType that enumerates its values. The
enumeration values are long; for example, here is one value:
<xs:enumeration value="end coordinates of the starting point and ending point"
/>
I wrote an XSLT program that generates a schema-conformant instance document.
Before validation I clicked on the Format/Indent button to get the instance
document nicely formatted. Then I clicked on the Associate Schema button. Then
I clicked on the Validate button.
Validation failed!
When I checked to see what failed, I saw this:
<shapeIsDefinedBy>end coordinates of the starting point and ending
point</shapeIsDefinedBy>
Yikes!
The formatting/indenting tool split the enumeration value across lines, which
created an invalid enumeration value.
Here's the trick I learned:
1. Load the instance document into Oxygen XML
2. Click on the Associate Schema button
3. Click on the Format/Indent button
4. Click on the Validate button
Do it in that order!
The key is to Associate Schema first and then Format/Indent. When you associate
a schema first, then the Oxygen format/indent tool knows that it shouldn't
split enumeration values across lines.
/Roger
_______________________________________________
oXygen-user mailing list
[email protected]
https://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________
oXygen-user mailing list
[email protected]
https://www.oxygenxml.com/mailman/listinfo/oxygen-user