Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On preprocessing - keep foreign namespace elements #51

Closed
phax opened this issue Aug 22, 2017 · 3 comments
Closed

On preprocessing - keep foreign namespace elements #51

phax opened this issue Aug 22, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@phax
Copy link
Owner

phax commented Aug 22, 2017

As outlined in #48;
Currently the following example:

<?xml version="1.0" encoding="utf-8"?>
<sch:schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:sch="http://purl.oclc.org/dsdl/schematron"
  queryBinding="xslt2"
  xmlns:sqf="http://example.org/sqf">
  
  <sch:ns prefix="sqf" uri="http://example.org/sqf" />
  
  <sch:pattern name="Customer">
    <sch:rule context="/file/Customer">
      <sch:assert test="base-uri()" role="fatal">
        base-uri is '<sch:value-of select="base-uri()" />'
        <sqf:fix id="a12"/>
      </sch:assert>
    </sch:rule>
  </sch:pattern>
</sch:schema> 

is preprocessed to

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
  <ns prefix="sqf" uri="http://example.org/sqf" />
  <pattern name="Customer">
    <rule context="/file/Customer">
      <assert test="base-uri()" role="fatal">
        <ns0:fix xmlns:ns0="http://example.org/sqf" id="a12" />
        base-uri is '<value-of select="base-uri()" />'
        
            </assert>
    </rule>
  </pattern>
</schema>

so the <sqf:fix id="a12"/> was moved and the namespace prefix went away...

@phax phax self-assigned this Aug 22, 2017
@phax phax added the bug label Aug 22, 2017
@phax phax added this to the v5.0.0 milestone Aug 22, 2017
@fviolette
Copy link

fviolette commented Aug 22, 2017

I actually only declare xmlns:sqf in <schema> this should be taken into account, if that behaves differently. I need to double check if my use or sch:ns is affected as well.

@phax phax modified the milestones: v5.0.0, v5.1 Jan 3, 2018
@phax
Copy link
Owner Author

phax commented Apr 30, 2019

The problem is the underyling data model, because the order of elements is not maintained in the PSAssertReport class - the foreign elements are always at the end

@phax
Copy link
Owner Author

phax commented Apr 30, 2019

Fixed in 5.0.10 - the order of foreign elements is now more flexible and not so strict. According to the RNG, foreign elements are usually only supported at the beginning of an element.

@phax phax closed this as completed Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants