Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:18:44+00:00 2026-06-04T04:18:44+00:00

I’m having difficulty validating an SXD schema combined with Schematron. Following the steps described

  • 0

I’m having difficulty validating an SXD schema combined with Schematron.

Following the steps described in this guide I’ve incorporated schematron between the <xs:appinfo> tags in an XSD document as follows:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="Test">

        <xs:annotation>
            <xs:appinfo>
                <sch:pattern name="Testing schematron" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                    <sch:rule context="Test">
                        <sch:assert test="@Attribute1">Attribute 1 exists</sch:assert>
                    </sch:rule>
                </sch:pattern>
            </xs:appinfo>
        </xs:annotation>

        <xs:complexType> 
            <xs:attribute name="Attribute1" type="xs:string" use="optional"/>
            <xs:attribute name="Attribute2" type="xs:string" use="optional"/>
        </xs:complexType>
    </xs:element>

</xs:schema>

This document is supposed to test (or validate) the document

<?xml version="1.0" encoding="ISO-8859-1"?>
<Test Attribute1="attr1"/>

using the simple xsltproc-based script listed on the schematron page. Unfortunately, I’m getting the following error message at the last step of the script.

step3.xsl:13: parser error : Extra content at the end of the document
plates select="*|comment()|processing-instruction()" mode="M0"/></axsl:template>
                                                                               ^
cannot parse step3.xsl

I’d appreciate help figuring out the cause of this error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:18:45+00:00Added an answer on June 4, 2026 at 4:18 am

    Your schema is correct and does what it is meant to do…

    The issue is with the script: this script expects to receive a Schematron schema and you give it a XML Schema with embedded rules which is a different kind of beast.

    To do your validation, you need to run a first transformation that will extract the Schematron from XML Schema and run validate on this result.

    And you could also use xmllint (libxml) to validate the document against the XML Schema which is a different operation.

    To do, you can change download ExtractSchFromXSD.xsl your script to:

    #!/bin/bash
    
    echo XSD validation
    xmllint -schema $1 $2
    
    echo Step0 ...
    xsltproc ExtractSchFromXSD.xsl $1 > schema.sch
    
    echo Step1 ...
    xsltproc iso_dsdl_include.xsl schema.sch > step1.xsl
    
    echo Step2 ...
    xsltproc iso_abstract_expand.xsl step1.xsl > step2.xsl
    
    echo Step3 ...
    xsltproc iso_svrl_for_xslt1.xsl step2.xsl > step3.xsl
    
    echo Validation ...
    xsltproc step3.xsl $2 | tee result.svrl
    

    Alternatively, you could use an implementation that natively supports embedded Schematron rules in schemas or a tool such as oXygen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.