Interesting and useful trick that I learned about Oxygen XML

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

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-edi... 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-schem... 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 oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
Oxygen XML Editor Support (Octavian Nadolu)
-
Roger L Costello