Issues Using oxy_add With Attribute Values Without Declaring A noNamespaceSchemaLocation
Posted: Wed Jun 14, 2017 10:49 pm
Hello,
I am working with a custom document and having issues using oxy_add.
I have created a basic document type, basicDocument.bd and the html framework to use the schema at: ${framework}/basicDocument.xsd.
The header of basicDocument.bd is
Within the schema, I have included (not imported) sub-schemas to keep things neat and organized. One of the schemas is for a section, estimatedCosts. estimatedCosts.xsd has variables that contain integer and decimal values. All values default to 0.
estimatedCosts.xsd (included in basicDocument.xsd):
(I realize that it may have been better to make the item costs and quantities elements instead of attributes - but that will be for a later update).
A basicDocument looks something like:
(itemCost1, itemCost2, itemQuantity1 and itemQuantity2 can be updated- but were set to 0 by default because oxy_add did not work properly when there was no default value).
When I use hard-coded numbers, oxy_add(10,5, 'number'), the function works perfectly.
When I use variables, oxy_add(attr(itemCost1), attr(itemCost2), 'number'), the function does not work - and only blank spaces are output. (I also only ever attempt to add attributes of the same type).
If I add an xsi:noNamespaceSchemaLocation to basicDocument.bd:
I can use variables without an issue.
I have verified that all of my schema and sub-schema files have identical header information - so I am confused as to why everything works except this one section - unless I add the noNamespaceSchemaLocation... especially because the noNamespaceSchemaLocation points to the same schema as the framework.
Is there a way to omit the noNamespaceSchemaLocation declaration from basicDocument.bd and have everything handled through the framework?
Any assistance would be appreciated!
Thanks!
I am working with a custom document and having issues using oxy_add.
I have created a basic document type, basicDocument.bd and the html framework to use the schema at: ${framework}/basicDocument.xsd.
The header of basicDocument.bd is
Code: Select all
<basicDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
estimatedCosts.xsd (included in basicDocument.xsd):
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xerces="http://xerces.apache.org"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified"
attributeFormDefault="unqualified" vc:minVersion="1.1"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xs:include schemaLocation="sharedAttributes.xsd"/>
<xs:element name="estimatedCost">
<xs:complexType>
<xs:attribute name="itemCost1" type="xs:decimal" default="0"/>
<xs:attribute name="itemCost2" type="xs:decimal" default="0"/>
<xs:attribute name="itemQuantity1" type="xs:integer" default="0"/>
<xs:attribute name="itemQuantity1" type="xs:integer" default="0"/>
</xs:complexType>
</xs:element>
</xs:schema>
A basicDocument looks something like:
Code: Select all
<basicDocument>
<...>
<estimatedCosts itemCost1="0" itemCost2="0" itemQuantity1="0" itemQuantity2="0" />
</...>
</basicDocument>
When I use hard-coded numbers, oxy_add(10,5, 'number'), the function works perfectly.
When I use variables, oxy_add(attr(itemCost1), attr(itemCost2), 'number'), the function does not work - and only blank spaces are output. (I also only ever attempt to add attributes of the same type).
If I add an xsi:noNamespaceSchemaLocation to basicDocument.bd:
Code: Select all
<basicDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../basicDocument.xsd">
I have verified that all of my schema and sub-schema files have identical header information - so I am confused as to why everything works except this one section - unless I add the noNamespaceSchemaLocation... especially because the noNamespaceSchemaLocation points to the same schema as the framework.
Is there a way to omit the noNamespaceSchemaLocation declaration from basicDocument.bd and have everything handled through the framework?
Any assistance would be appreciated!
Thanks!