Project

Profile

Help

Bug #1485

closed

XSD 1.1 saxon:preprocess does not actually preprocess

Added by Priscilla Walmsley about 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
2012-04-19
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I am not able to get the saxon:preprocess facet to work. It seems to recognize that it is an allowed element in the content model of , but it does not do the preprocessing or validate my document.

Below is the example I used, similar to the one in the Saxon documentation. I also tried upper-case(.), various other built-in functions, and namespace prefixes on the upper-case function.

Schema: (newsch3.xsd)

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

       xmlns:saxon="http://saxon.sf.net/">

<xs:element name="newSize" type="SMLXSizeType"/>

<xs:simpleType name="SMLXSizeType">

<xs:restriction base="xs:token">

  <saxon:preprocess action="upper-case($value)"/>

  <xs:enumeration value="SMALL"/>

  <xs:enumeration value="MEDIUM"/>

  <xs:enumeration value="LARGE"/>

  <xs:enumeration value="EXTRA LARGE"/>

</xs:restriction>

</xs:simpleType>

</xs:schema>

Instance:

<newSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="newsch3.xsd">small

Output:

The content "small" of element does not match the required simple type. Value

"small" contravenes the enumeration facet "EXTRA LARGE, LARGE, MEDIUM, SM..." of the type

SMLXSizeType (See http://www.w3.org/TR/xmlschema11-2/#cvc-datatype-valid clause 1)

Validation error on line 2 column 61 of EX83a_1.xml:

XQDY0027: One or more validation errors were reported

Actions #1

Updated by Priscilla Walmsley about 12 years ago

A followup: when I run a test to see if it's available via vc:facetAvailable, it thinks it is not available. Do I need to do something special when invoking Saxon to include these extension facets? (other than use XSD version 1.1, which I already am doing.)

But also, if it thinks the facet is not available, shouldn't it raise an error saying it doesn't understand the facet when I try to use it, rather than silently ignoring it?

Actions #2

Updated by Michael Kay about 12 years ago

  • Status changed from New to In Progress
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal

Confirmed as a bug. It seems that some late change was made before 9.4 release that caused the preprocess code not to be invoked; and unfortunately the test cases had not been fully integrated into the automatic testing programme so the change went unnoticed. The underlying code is all present so it should not be difficult to patch the feature back in.

Actions #3

Updated by Michael Kay about 12 years ago

  • Status changed from In Progress to Resolved
  • Found in version changed from 9.4.0.3 to 9.4

A patch is being committed, and new test cases have been written, including a test for vc:facetsAvailable="saxon:preprocess".

Actions #4

Updated by Michael Kay almost 12 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.4.0.4

Please register to edit this issue

Also available in: Atom PDF