<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
  <channel>
    <title>
Altova Mailing List: xmlschema-dev
    </title>
    <link>http://www.altova.com/</link>
    <description>Altova accelerates application development and data management projects with software and solutions that enhance productivity and maximize results. As an innovative, customer-focused company and the creator of XMLSpy and other leading XML, data administration, UML, and Web services tools, Altova is the choice of over 3 million clients worldwide, including virtually every Fortune 500 company. With customers ranging from vast development teams in the worldâ€™s largest organizations to progressive one-person shops, Altovaâ€™s line of software applications fulfills a broad spectrum of business needs. Altova is an active member of the World Wide Web Consortium (W3C) and Object Management Group (OMG) and is committed to delivering standards-based platform-independent solutions that are powerful, affordable, and easy to use. Altova was founded in 1992 and has headquarters in Beverly, Massachusetts and Vienna, Austria.</description>
    <language>en-us</language>
    <copyright>Copyright Â© 2005, 2006, 2007 Altova GmbH. All rights reserved. Altova, XMLSpy, MapForce, StyleVision, SemanticWorks, SchemaAgent, UModel, DiffDog, and Authentic are trademarks and/or registered trademarks of Altova GmbH in the United States and/or other countries. The names of and reference to other companies and products mentioned herein may be the trademarks of their respective owners.</copyright>
    <pubDate>Tue, 03 Jun 2008 10:00:00 EDT</pubDate>
    <lastBuildDate>Tue, 03 Jun 2008 10:00:00 EDT</lastBuildDate>
    <generator>Authentic RSS Editor, visit www.altova.com for details</generator>
    <managingEditor>pr@altova.com</managingEditor>
    <webMaster>webmaster@altova.com</webMaster>
    <image>
      <url>http://www.altova.com/images/logos/altova_right_120.gif</url>
      <title>ALTOVA</title>
      <link>http://www.altova.com/</link>
      <width>120</width>
      <height>24</height>
      <description>Altova Logo</description>
    </image>

<item>
<title>Re: Why can an element in an included no-namespace schema reference  - 1/28/2012 11:23:00 PM</title>
<description><![CDATA[<pre>On 28/01/2012 23:00, Costello, Roger L. wrote:
&gt;
&gt; Why can element B2 reference type XYZ without a default namespace declaration but element A1 couldn't?
&gt;
&gt; /Roger
&gt;
&gt;
Chameleon includes are described differently in XSD 1.1 from the way 
they are described in XSD 1.0, though the intent was merely to provide a 
more rigorous description, not to change the behaviour.

In 1.1 the description is in terms of a stylesheet: see

http://www.w3.org/TR/2012/PR-xmlschema11-1-20120119/#chameleon-xslt

When this stylesheet sees type=&quot;xyz&quot;, it transforms it into 
type=&quot;n:xyz&quot;, where n is a namespace prefix that has been bound to the 
new target namespace.

More generally, the effect of the chameleon include is to take the 
included no-namespace schema, and transform it (a) so that all 
components are declared to be in the target namespace, and (b) all 
references to components in no namespace are converted into references 
to components in the target namespace with the same local name.

Michael Kay
Saxonica</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324313.html</link>
</item><item>
<title>Why can an element in an included no-namespace schema reference a  - 1/28/2012 11:02:00 PM</title>
<description><![CDATA[<pre>Hi Folks,

The following schema document is erroneous because the element A1 is trying to reference a type XYZ in no-namespace:

A.xsd
----------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; 
                        targetNamespace=&quot;http://www.example.org&quot; 
                       elementFormDefault=&quot;qualified&quot;&gt;

    &lt;xs:include schemaLocation=&quot;B.xsd&quot;/&gt;

    &lt;xs:simpleType name=&quot;XYZ&quot;&gt;
        &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:maxLength value=&quot;10&quot;/&gt;
        &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
    
    &lt;xs:element name=&quot;A1&quot; type=&quot;XYZ&quot; /&gt;
    
&lt;/xs:schema&gt;
----------------------------------------------------------------------

The error is fixed by adding a default namespace declaration:

A.xsd
----------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; 
                        targetNamespace=&quot;http://www.example.org&quot; 
                       xmlns=&quot;http://www.example.org&quot;
                       elementFormDefault=&quot;qualified&quot;&gt;

    &lt;xs:include schemaLocation=&quot;B.xsd&quot;/&gt;

    &lt;xs:simpleType name=&quot;XYZ&quot;&gt;
        &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:maxLength value=&quot;10&quot;/&gt;
        &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
    
    &lt;xs:element name=&quot;A1&quot; type=&quot;XYZ&quot; /&gt;
    
&lt;/xs:schema&gt;
----------------------------------------------------------------------

Good.

Now let's remove the element A1 and remove the default namespace declaration. This is a valid schema:

A.xsd
----------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; 
           targetNamespace=&quot;http://www.example.org&quot; 
           elementFormDefault=&quot;qualified&quot;&gt;

    &lt;xs:include schemaLocation=&quot;B.xsd&quot;/&gt;

    &lt;xs:simpleType name=&quot;XYZ&quot;&gt;
        &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:maxLength value=&quot;10&quot;/&gt;
        &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
    
&lt;/xs:schema&gt;
----------------------------------------------------------------------

Notice that the schema document includes B.xsd. Let's look at it. It is a no-namespace schema document:

B.xsd
----------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt; 
    
    &lt;xs:element name=&quot;B2&quot; type=&quot;XYZ&quot; /&gt;
    
&lt;/xs:schema&gt;
----------------------------------------------------------------------

Since A.xsd has a targetNamespace the B.xsd schema document is namespace-coerced to the namespace of A.xsd.

Observe that element B2 references type XYZ which is in A.xsd.

When I validate A.xsd it validates fine.

Hey!  How can that be?

Recall that I removed the default namespace declaration from A.xsd. 

Why can element B2 reference type XYZ without a default namespace declaration but element A1 couldn't?

/Roger</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324312.html</link>
</item><item>
<title>CFP: RuleML-2012@ECAI (6th International Symposium on Rules) - 1/25/2012 4:26:00 PM</title>
<description><![CDATA[<pre>===============
CALL FOR PAPERS
===============

The 6th International Symposium on Rules: Research Based and Industry
Focused, Montpellier, France, August 27-29, 2012.
http://2012.ruleml.org

The International Symposium on Rules, RuleML, has evolved from an annual
series of international workshops since 2002, international conferences in
2005 and 2006, and international symposia since 2007. This year the RuleML
Symposium will be held in conjunction with ECAI 2012, the 20th biennial
European Conference on Artificial Intelligence, in Montpellier, France,
August 27-29, 2012. RuleML 2012 will be the host of the 7th AIS SigPrag
International Conference on Pragmatic Web (ICPW 2012).


Objectives
============================================

RuleML-2012@ECAI is a research-based, industry-focused symposium: its main
goal is to build a bridge between academia and industry in the field of
rules and semantic technology, and so to stimulate the cooperation and
interoperability between business and research, by bringing together rule
system providers, participants in rule standardization efforts, open source
communities, practitioners, and researchers. The concept of the symposium
has also advanced continuously in the face of extremely rapid progress in
practical rule and event processing technologies. As a result,
RuleML-2012will feature hands-on demonstrations and challenges
alongside a wide range
of thematic tracks. It will thus be an exciting venue to exchange new ideas
and experiences on all issues related to the engineering, management,
integration, interoperation, and interchange of rules in distributed
enterprise intranets and open distributed environments.

We invite you to share your ideas, results, and experiences: as an industry
practitioner, rule system provider, technical expert and developer, rule
user or researcher, exploring foundations, developing systems and
applications, or using rule-based systems.


Topics
============================================

We invite high-quality submissions related to (but not limited to) one or
more of the following topics:

   * Rules and Automated Reasoning
   * Logic Programming and Non-monotonic Reasoning
   * Int. Conference track on Pragmatic Web (see track description below)
   * Rule-Based Policies, Reputation and Trust
   * Rule-based Event Processing and Reaction Rules
   * Fuzzy Rules and Uncertainty
   * Rule Transformation, Extraction and Learning
   * Vocabularies, Ontologies, and Business rules
   * Rules in online-market research and online marketing
   * Rule Markup Languages and Rule Interchange
   * General Rule Topics


Important Dates
============================================

Abstract submission: March 25, 2012
Paper submission: April 1, 2012
Notification of acceptance/rejection: May 20, 2012
Camera-ready copy due: June 10, 2012
RuleML-2012 dates: August 27-29, 2012


Submission guidelines
============================================

Papers must be in English and must be submitted at
http://www.easychair.org/conferences/?conf=ruleml2012 as:

   * Full Papers (15 pages in the proceedings)
   * Short Papers (8 pages in the proceedings)

Please upload all submissions as PDF files based on the LNCS format (
http://www.springer.de/comp/lncs/authors.html). The selected papers will be
published in book form in the Springer Lecture Notes in Computer Science
(LNCS) series.


Organization
============================================

General Chairs:
Grigoris Antoniou, Institute of Computer Science, FO.R.T.H., GR
Guido Governatori, NICTA, Australia

Program Chairs:
Antonis Bikakis, University College London, UK
Adrian Giurca, Brandenburg University of Technology, DE


Satellite Events
============================================

The RuleML2012 Conference is also hosting

   * The 7th AIS SigPrag International Conference Track on Pragmatic Web
   * The RuleML2012 Doctoral Consortium:
http://2012.ruleml.org/phdconsortium
   * The 6th International Rule Challenge:
http://2012.ruleml.org/rulechallenge


Int. Conference on Pragmatic Web (ICPW 2012)
============================================

The conference track on PRAGMATIC WEB is part of RuleML-2012 and centred
around the study of &quot;pragmatics&quot;  in the Semantic Web. That is, it draws
attention to how communicative actions are performed by agents via  Web
media and illuminates how mutual understanding and commitments to actions
can evolve in (agent) conversations. This year the Pragmatic Web conference
track has a special focus on the applications of rule-based technologies
and AI agent technologies for the Pragmatic Web. Topics of Interest include
one or more of the following topics (but are not limited to):

 * Rule-Based Distributed/Multi-Agent Systems
 * Rules, Agents and Norms
 * Rule-Based Communication, Dialogue and Argumentation Models
 * Vocabularies / ontologies for pragmatic primitives (e.g. speech acts,
deontic primitives)
 * Pragmatic Web reasoning and distributed rule inference / rule execution

For further information about the Pragmatic Web see
http://www.pragmaticweb.info/


RuleML 2012 Doctoral Consortium
============================================

The RuleML 2012 Doctoral Consortium is an initiative of the International
Symposium on Rules, RuleML, to attract and promote Ph.D. research in the
area of Rules and Markup Languages. The doctoral symposium offers to
students a close contact with leading experts on the field, as well as the
opportunity to present and discuss their ideas in a dynamic and friendly
setting. The accepted thesis descriptions will be presented to an
interested audience and subject to discussion with a panel of senior
researchers, and we expect submissions on any (but not limited to) of this
year's RuleML2012@ECAI topics.

Students are invited to submit an original description of their work
addressing the following aspects:

   * A clear formulation of the research question.
   * An identification of the significant problems in the field of research..
   * An outline of the current knowledge of the problem domain, as well as
the state of existing solutions.
   * A presentation of any preliminary ideas, the proposed approach and the
results achieved so far.
   * A sketch of the applied research methodology.
   * A description of the Ph.D. project's contribution to the problem
solution.
   * A discussion of how the suggested solution is different, new, or
better as compared
     to existing approaches to the problem.

Accepted submissions will be published in internal proceedings and later on
published in CEUR Workshop Proceedings (http://www.ceur-ws.org) volume of
RuleML.

Important Dates
----------------------------------------
Paper submission:                     June 25, 2012
Notification of acceptance/rejection: July 16, 2012
Camera-ready copy due:                July 30, 2012
Doctoral Consortium date:             August 27, 2012

Submission guidelines
----------------------------------------
Thesis descriptions are limited to 8 pages in English using LNCS format (
http://www.springer.de/comp/lncs/authors.html) and submitted electronically
in PDF format jointly with a maximum 5 page CV.

Please submit to:
http://www.easychair.org/conferences/?conf=ruleml2012consortium

If you have no EasyChair account, then you should sign up for an account at
https://www.easychair.org/account/signup.cgi?conf=ruleml2012consortium

Chairs
----------------------------------------
Grzegorz J. Nalepa, AGH University of Science and Technology, Krak&#195;&#179;w,
Poland
Monica Palmirani, CIRSFID-University of Bologna, Italy


6th International Rule Challenge
============================================

The International RuleML2012@ECAI Challenge is one of the highlights of the
RuleML2012 conference. The challenge is dedicated to practical experiences
with rule-oriented applications. In particular, submissions of
benchmarks/evaluations, demos, case studies/use cases, experience reports,
best practice solutions (e.g. design patterns, reference architectures,
models), rule-based implementations/tools/applications, demonstrations of
engineering methods, implementations of rule standards (e.g. RuleML, RIF,
SBVR, PRR, rule-based Event Processing languages, BPMN+rules,
BPEL+rules,...), rules + industrial standards (e.g. XBRL, MISMO,
Accord,...), and industrial problem statements are particularly encouraged.

Key themes of the International RuleML2012@ECAI Challenge include (but they
are NOT limited to) the following:

   * Industrial rule-based applications includiong rule-based Web
applications
   * Demos related to the RuleML2012@ECAI Topics
   * Extensions and implementations of rule standards: W3C RIF, RuleML,
SBVR,...
   * Editing environments and IDEs for Web rules
   * Benchmarks and comparison results for rule engines
   * Distributed rule bases and rule services
   * Reports on industrial experience about rule systems

Previous challenge editions were in Ft Lauderdale, Florida (
http://2011.ruleml.org/america/challenge ), in Washington, DC (
http://2010.ruleml.org/ruleml-2010-challenge.html ), in Las Vegas, Nevada (
http://2009.ruleml.org/challenge ) and Orlando, Florida (
http://2008.ruleml.org/challenge.php  and
http://2007.ruleml.org/index-Dateien/Page787.htm).

RuleML2012Challenge is the first edition taking place in Europe.

Important Dates
----------------------------------------
Abstract submission:                        March 6, 2012
Paper submission:                            May 25, 2012
Notification of acceptance/rejection:   July 1, 2012
Camera-ready copy due:                   July 15, 2012
RuleML Challenge date:                    TBA


Submission guidelines
----------------------------------------
Submissions to the International RuleML2012@ECAI Challenge consist of:

  1. An early 1 page abstract announcing the application.
  2. An open-source or commercial demo
  3. A demo paper, using LNCS format, describing research, implementation,
and technical details of your submission.

Submit both the demo and the paper to
http://www.easychair.org/conferences/?conf=ruleml2012challenge.
Would you have an online demo please indicate in the description paper an
URL were it can be tested and evaluated.

If you have no EasyChair account, then you should sign up for an account at
https://www.easychair.org/account/signup.cgi?conf=ruleml2012challenge

Chairs
----------------------------------------
Adrian Giurca, Yuh-Jong Hu and Dumitru Roman</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324292.html</link>
</item><item>
<title>RE: Invoking schema validation processors - 1/11/2012 5:06:00 PM</title>
<description><![CDATA[<pre>Thanks for the suggestion, Clemens, but I see 
that its use requires obtaining a free license 
key, plus it appears to be Windows only.  Those 
aspects would prevent me from including it in the OASIS UBL distribution.

That xjparse is a portable JAR file allows me to 
use that today in the distribution.  There are 
both Windows and shell demonstration scripts that 
run for users of the UBL package.

I've filed a report on xjparse and will make a 
note to this list when this issue has been repaired by Norm:

   https://github.com/ndw/xjparse/issues/1

. . . . . . . . . Ken

At 2012-01-11 17:45 +0100, office xml-tools.com wrote:
&gt;Dear Ken,
&gt;
&gt;you could use the free XML ValidatorBuddy Command Line Tool (for Windows)
&gt;which is available at: http://www.xml-tools.com/download.htm
&gt;
&gt;I was able to successfully validate your sample files. The tool also uses
&gt;the Xerces 3.1 parser internally. If one of the XML documents is invalid an
&gt;exit code of -1 is returned, otherwise it returns 0.
&gt;
&gt;This would be the output on calling:
&gt;valbuddy.exe -v -verbose test2.xml
&gt;
&gt;XML ValidatorBuddy command-line Tool
&gt;By xml-tools.com, Copyright 2012
&gt;
&gt;G:\Users\xml\Ken Holman\test2.xml: invalid
&gt;Line: 6, Col: 6 : no declaration found for element 'doc'
&gt;Line: 2, Col: 8 : no declaration found for element 'test'
&gt;
&gt;
&gt;And this is the output on calling:
&gt;Valbuddy.exe -v -verbose -s test.xsd test2.xml
&gt;
&gt;XML ValidatorBuddy command-line Tool
&gt;By xml-tools.com, Copyright 2012
&gt;
&gt;G:\Users\xml\Ken Holman\test2.xml: valid
&gt;
&gt;
&gt;Best regards
&gt;
&gt;Clemens Uhlenhut
&gt;http://www.xml-tools.com
&gt;
&gt;
&gt;
&gt;-----Original Message-----
&gt;From: G. Ken Holman [mailto:gkholman@CraneSoftwrights.com]
&gt;Sent: Dienstag, 10. J&#228;nner 2012 18:33
&gt;To: xmlschema-dev@w3.org
&gt;Subject: Re: Invoking schema validation processors
&gt;
&gt;At 2012-01-10 11:54 -0500, Michael Glavassevich wrote:
&gt; &gt;If Xerces is performing DTD and XSD validation at the same time it's
&gt; &gt;because the application (xjparse in this case) configured it [1] (by
&gt; &gt;accident?) to do so. There are multiple ways to get Xerces to do XSD
&gt; &gt;validation [2] only.
&gt;
&gt;What I cannot see at that FAQ is how to accomplish this from the command
&gt;line.
&gt;
&gt;The UBL community's users are running validation from batch files.
&gt;
&gt;Thanks, again, for any guidance.
&gt;
&gt;. . . . . . . . . . . . Ken


--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324140.html</link>
</item><item>
<title>RE: Invoking schema validation processors - 1/11/2012 4:48:00 PM</title>
<description><![CDATA[<pre>Dear Ken,

you could use the free XML ValidatorBuddy Command Line Tool (for Windows)
which is available at: http://www.xml-tools.com/download.htm

I was able to successfully validate your sample files. The tool also uses
the Xerces 3.1 parser internally. If one of the XML documents is invalid an
exit code of -1 is returned, otherwise it returns 0.

This would be the output on calling:
valbuddy.exe -v -verbose test2.xml

XML ValidatorBuddy command-line Tool
By xml-tools.com, Copyright 2012

G:\Users\xml\Ken Holman\test2.xml: invalid
Line: 6, Col: 6 : no declaration found for element 'doc'
Line: 2, Col: 8 : no declaration found for element 'test'


And this is the output on calling:
Valbuddy.exe -v -verbose -s test.xsd test2.xml

XML ValidatorBuddy command-line Tool
By xml-tools.com, Copyright 2012

G:\Users\xml\Ken Holman\test2.xml: valid


Best regards

Clemens Uhlenhut
http://www.xml-tools.com



-----Original Message-----
From: G. Ken Holman [mailto:gkholman@CraneSoftwrights.com] 
Sent: Dienstag, 10. J&#228;nner 2012 18:33
To: xmlschema-dev@w3.org
Subject: Re: Invoking schema validation processors

At 2012-01-10 11:54 -0500, Michael Glavassevich wrote:
&gt;If Xerces is performing DTD and XSD validation at the same time it's 
&gt;because the application (xjparse in this case) configured it [1] (by 
&gt;accident?) to do so. There are multiple ways to get Xerces to do XSD 
&gt;validation [2] only.

What I cannot see at that FAQ is how to accomplish this from the command
line.

The UBL community's users are running validation from batch files.

Thanks, again, for any guidance.

. . . . . . . . . . . . Ken


--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324139.html</link>
</item><item>
<title>Re: Invoking schema validation processors - 1/10/2012 6:13:00 PM</title>
<description><![CDATA[<pre>&quot;G. Ken Holman&quot; &lt;gkholman@CraneSoftwrights.com&gt; wrote on 01/10/2012
12:32:41 PM:

&gt; At 2012-01-10 11:54 -0500, Michael Glavassevich wrote:
&gt; &gt;If Xerces is performing DTD and XSD validation at the same time it's
&gt; &gt;because the application (xjparse in this case) configured it [1] (by
&gt; &gt;accident?) to do so. There are multiple ways to get Xerces to do XSD
&gt; &gt;validation [2] only.
&gt;
&gt; What I cannot see at that FAQ is how to accomplish this from the command
line.

You could use one of Xerces' validation samples [3] instead.

&gt; The UBL community's users are running validation from batch files.
&gt;
&gt; Thanks, again, for any guidance.
&gt;
&gt; . . . . . . . . . . . . Ken
&gt;
&gt;
&gt; --
&gt; Contact us for world-wide XML consulting and instructor-led training
&gt; Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
&gt; Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
&gt; G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
&gt; Google+ profile: https://plus.google.com/116832879756988317389/about
&gt; Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

[3] http://xerces.apache.org/xerces2-j/samples-jaxp.html#SourceValidator

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324130.html</link>
</item><item>
<title>Re: Invoking schema validation processors - 1/10/2012 5:41:00 PM</title>
<description><![CDATA[<pre>At 2012-01-10 16:01 +0000, Michael Kay wrote:
&gt;I suspect that some parsers interpret the presence of a &lt;DOCTYPE&gt; 
&gt;declaration as an instruction to perform DTD validation,

Precisely.  I could analyze that that is what was wrong, but I have 
no guidance from the documentation on how to get my users running 
command-line scripts to turn off DTD validation but preserve the 
entity processing.  Hence my post to the list.

BTW, I've had no problems with Saxon performing the validation 
exactly as I need, but the old (ancient) version of 9SA that I have 
doesn't appear to return a non-zero return code on a validation 
error.  Reading the invocation arguments in the help provided when no 
arguments are supplied doesn't appear to offer any way to impact the 
return code.

Thanks for confirming my analysis of the situation.

My only issue is that I'm using all these tools from the command line 
and not from inside a program and so I am limited to what can be 
offered from and to a script.

. . . . . . . . . . . . Ken


--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324129.html</link>
</item><item>
<title>Re: Invoking schema validation processors - 1/10/2012 5:39:00 PM</title>
<description><![CDATA[<pre>At 2012-01-10 11:54 -0500, Michael Glavassevich wrote:
&gt;If Xerces is performing DTD and XSD validation at the same time it's 
&gt;because the application (xjparse in this case) configured it [1] (by 
&gt;accident?) to do so. There are multiple ways to get Xerces to do XSD 
&gt;validation [2] only.

What I cannot see at that FAQ is how to accomplish this from the command line.

The UBL community's users are running validation from batch files.

Thanks, again, for any guidance.

. . . . . . . . . . . . Ken


--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324128.html</link>
</item><item>
<title>Re: Invoking schema validation processors - 1/10/2012 4:56:00 PM</title>
<description><![CDATA[<pre>Michael Kay &lt;mike@saxonica.com&gt; wrote on 01/10/2012 11:01:46 AM:

&gt; On 10/01/2012 15:14, G. Ken Holman wrote:
&gt; &gt; Hi, folks!  And happy new year!
&gt; And to you, Ken
&gt; &gt;
&gt; &gt; Can anyone help me with the invocations of Xerces and Altova W3C
&gt; &gt; Schema validation?  These processors are reporting problems with valid
&gt; &gt; XML documents and I'm hoping that with the right incantations I'll get
&gt; &gt; rid of the error messages.
&gt; &gt;
&gt; &gt; If I don't use external parsed general entities, everything is fine.
&gt; &gt; When I do, the processors are expecting to find element DTD
&gt; &gt; declarations that do not exist.
&gt; I suspect that some parsers interpret the presence of a &lt;DOCTYPE&gt;
&gt; declaration as an instruction to perform DTD validation, and that most
&gt; of your problems here are that you don't actually want DTD validation
&gt; done.

If Xerces is performing DTD and XSD validation at the same time it's
because the application (xjparse in this case) configured it [1] (by
accident?) to do so. There are multiple ways to get Xerces to do XSD
validation [2] only.

&gt; A lot of the confusion here seems to be that DTD validation and
&gt; XSD validation are happening at the same time and the messages from both
&gt; are getting mixed up.
&gt;
&gt; Michael Kay
&gt; Saxonica

[1] http://xerces.apache.org/xerces2-j/faq-pcfp.html#faq-3
[2] http://xerces.apache.org/xerces2-j/faq-pcfp.html#faq-4

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324127.html</link>
</item><item>
<title>Re: Invoking schema validation processors - 1/10/2012 4:06:00 PM</title>
<description><![CDATA[<pre>On 10/01/2012 15:14, G. Ken Holman wrote:
&gt; Hi, folks!  And happy new year!
And to you, Ken
&gt;
&gt; Can anyone help me with the invocations of Xerces and Altova W3C 
&gt; Schema validation?  These processors are reporting problems with valid 
&gt; XML documents and I'm hoping that with the right incantations I'll get 
&gt; rid of the error messages.
&gt;
&gt; If I don't use external parsed general entities, everything is fine.  
&gt; When I do, the processors are expecting to find element DTD 
&gt; declarations that do not exist.
I suspect that some parsers interpret the presence of a &lt;DOCTYPE&gt; 
declaration as an instruction to perform DTD validation, and that most 
of your problems here are that you don't actually want DTD validation 
done. A lot of the confusion here seems to be that DTD validation and 
XSD validation are happening at the same time and the messages from both 
are getting mixed up.

Michael Kay
Saxonica
&gt;
&gt; A transcript is below.  I'm invoking Xerces using Norm's xjparse with 
&gt; the &quot;-S&quot; option.  The &quot;test3&quot; example illustrates that for Xerces XSD 
&gt; validation is detecting the bad content even while the processor 
&gt; complains about the DTD declarations being missing ... which goes 
&gt; farther than Altova.
&gt;
&gt; Thank you for any guidance anyone may have regarding invocations.
&gt;
&gt; . . . . . . . . . Ken
&gt;
&gt; T:\ftemp&gt;type test.xsd
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
&gt;   elementFormDefault=&quot;qualified&quot;&gt;
&gt; &lt;xs:element name=&quot;doc&quot;&gt;
&gt; &lt;xs:complexType&gt;
&gt; &lt;xs:sequence&gt;
&gt; &lt;xs:element name=&quot;test&quot;/&gt;
&gt; &lt;/xs:sequence&gt;
&gt; &lt;/xs:complexType&gt;
&gt; &lt;/xs:element&gt;
&gt; &lt;/xs:schema&gt;
&gt;
&gt; T:\ftemp&gt;type test1.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;doc&gt;&lt;test/&gt;&lt;/doc&gt;
&gt;
&gt; T:\ftemp&gt;w3cschema test.xsd test1.xml
&gt; Xerces...
&gt; No validation errors.
&gt; Saxon...
&gt; No validation errors.
&gt; Altova...
&gt; The XML data is valid.
&gt;
&gt; T:\ftemp&gt;type test2.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;!DOCTYPE doc
&gt;   [
&gt; &lt;!ENTITY test SYSTEM &quot;test2.ent&quot;&gt;
&gt;   ]&gt;
&gt; &lt;doc&gt;&amp;test;&lt;/doc&gt;
&gt;
&gt; T:\ftemp&gt;type test2.ent
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;test/&gt;
&gt;
&gt; T:\ftemp&gt;w3cschema test.xsd test2.xml
&gt; Xerces...
&gt; Attempting validating, namespace-aware parse
&gt; Error:file:///T:/ftemp/test2.xml:6:6:Element type &quot;doc&quot; must be declared.
&gt; Error:file:///T:/ftemp/test2.ent:2:8:Element type &quot;test&quot; must be 
&gt; declared.
&gt; Parse succeeded (0.250) with 2 errors and no warnings.
&gt; Saxon...
&gt; No validation errors.
&gt; Altova...
&gt; The XML data is invalid.
&gt; No external markup declarations present - referenced entity '&amp;test;' 
&gt; must be declared.
&gt;
&gt; T:\ftemp&gt;type test3.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;!DOCTYPE doc
&gt;   [
&gt; &lt;!ENTITY test SYSTEM &quot;test3.ent&quot;&gt;
&gt;   ]&gt;
&gt; &lt;doc&gt;&amp;test;&lt;/doc&gt;
&gt;
&gt; T:\ftemp&gt;type test3.ent
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;testbad/&gt;
&gt;
&gt; T:\ftemp&gt;w3cschema test.xsd test3.xml
&gt; Xerces...
&gt; Attempting validating, namespace-aware parse
&gt; Error:file:///T:/ftemp/test3.xml:6:6:Element type &quot;doc&quot; must be declared.
&gt; Error:file:///T:/ftemp/test3.ent:2:11:Element type &quot;testbad&quot; must be 
&gt; declared.
&gt; Error:file:///T:/ftemp/test3.ent:2:11:cvc-complex-type.2.4.a: Invalid 
&gt; content was found starting with element 'testbad'. One of '{test}' is 
&gt; expected.
&gt; Parse succeeded (0.340) with 3 errors and no warnings.
&gt; Saxon...
&gt; Validation error on line 2 column 11 of test3.ent:
&gt;   In content of element &lt;doc&gt;: The content model does not allow 
&gt; element &lt;testbad&gt; to appear
&gt;   here. Expected: test (See 
&gt; http://www.w3.org/TR/xmlschema-1/#cvc-complex-type clause 2.4)
&gt; Altova...
&gt; The XML data is invalid.
&gt; No external markup declarations present - referenced entity '&amp;test;' 
&gt; must be declared.
&gt;
&gt; T:\ftemp&gt;
&gt;
&gt; -- 
&gt; Contact us for world-wide XML consulting and instructor-led training
&gt; Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
&gt; Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
&gt; G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
&gt; Google+ profile: https://plus.google.com/116832879756988317389/about
&gt; Legal business disclaimers:    http://www.CraneSoftwrights.com/legal
&gt;
&gt;
&gt;</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324126.html</link>
</item><item>
<title>Invoking schema validation processors - 1/10/2012 3:17:00 PM</title>
<description><![CDATA[<pre>Hi, folks!  And happy new year!

Can anyone help me with the invocations of Xerces and Altova W3C 
Schema validation?  These processors are reporting problems with 
valid XML documents and I'm hoping that with the right incantations 
I'll get rid of the error messages.

If I don't use external parsed general entities, everything is 
fine.  When I do, the processors are expecting to find element DTD 
declarations that do not exist.

A transcript is below.  I'm invoking Xerces using Norm's xjparse with 
the &quot;-S&quot; option.  The &quot;test3&quot; example illustrates that for Xerces XSD 
validation is detecting the bad content even while the processor 
complains about the DTD declarations being missing ... which goes 
farther than Altova.

Thank you for any guidance anyone may have regarding invocations.

. . . . . . . . . Ken

T:\ftemp&gt;type test.xsd
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
   elementFormDefault=&quot;qualified&quot;&gt;
  &lt;xs:element name=&quot;doc&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name=&quot;test&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
&lt;/xs:schema&gt;

T:\ftemp&gt;type test1.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;doc&gt;&lt;test/&gt;&lt;/doc&gt;

T:\ftemp&gt;w3cschema test.xsd test1.xml
Xerces...
No validation errors.
Saxon...
No validation errors.
Altova...
The XML data is valid.

T:\ftemp&gt;type test2.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE doc
   [
    &lt;!ENTITY test SYSTEM &quot;test2.ent&quot;&gt;
   ]&gt;
&lt;doc&gt;&amp;test;&lt;/doc&gt;

T:\ftemp&gt;type test2.ent
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;test/&gt;

T:\ftemp&gt;w3cschema test.xsd test2.xml
Xerces...
Attempting validating, namespace-aware parse
Error:file:///T:/ftemp/test2.xml:6:6:Element type &quot;doc&quot; must be declared.
Error:file:///T:/ftemp/test2.ent:2:8:Element type &quot;test&quot; must be declared.
Parse succeeded (0.250) with 2 errors and no warnings.
Saxon...
No validation errors.
Altova...
The XML data is invalid.
No external markup declarations present - referenced entity '&amp;test;' 
must be declared.

T:\ftemp&gt;type test3.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE doc
   [
    &lt;!ENTITY test SYSTEM &quot;test3.ent&quot;&gt;
   ]&gt;
&lt;doc&gt;&amp;test;&lt;/doc&gt;

T:\ftemp&gt;type test3.ent
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;testbad/&gt;

T:\ftemp&gt;w3cschema test.xsd test3.xml
Xerces...
Attempting validating, namespace-aware parse
Error:file:///T:/ftemp/test3.xml:6:6:Element type &quot;doc&quot; must be declared.
Error:file:///T:/ftemp/test3.ent:2:11:Element type &quot;testbad&quot; must be declared.
Error:file:///T:/ftemp/test3.ent:2:11:cvc-complex-type.2.4.a: Invalid 
content was found starting with element 'testbad'. One of '{test}' is expected.
Parse succeeded (0.340) with 3 errors and no warnings.
Saxon...
Validation error on line 2 column 11 of test3.ent:
   In content of element &lt;doc&gt;: The content model does not allow 
element &lt;testbad&gt; to appear
   here. Expected: test (See 
http://www.w3.org/TR/xmlschema-1/#cvc-complex-type clause 2.4)
Altova...
The XML data is invalid.
No external markup declarations present - referenced entity '&amp;test;' 
must be declared.

T:\ftemp&gt;

--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324125.html</link>
</item><item>
<title>Re: SimpleType not enforced for extended element - 1/6/2012 9:47:00 AM</title>
<description><![CDATA[<pre>On 06/01/2012 08:26, Karl Stubsjoen wrote:
&gt;
&gt; I am kicking myself!
&gt;
&gt; Now the real challenge and probably a lot off topic..
&gt; I have a base schema class.
&gt; I have a working schema class. It includes base and certain elements 
&gt; extend base types.
&gt; I compile the base class with Xsd2Code.
&gt;
I think there is probably a better forum for asking questions about the 
Xsd2Code product, which is probably unfamiliar to most people on this list.

Michael Kay
Saxonica</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324101.html</link>
</item><item>
<title>Re: SimpleType not enforced for extended element - 1/6/2012 8:28:00 AM</title>
<description><![CDATA[<pre>I am kicking myself!

Now the real challenge and probably a lot off topic..
I have a base schema class.
I have a working schema class. It includes base and certain elements extend
base types.
I compile the base class with Xsd2Code.
I compile the working schema with Xsd2Code with instructions to not compile
the included schema rules.
The objective: write generic code for the base class and strongly tied code
for the working class hoping that I can easily invoke my core business
objects that is expecting the base schema code. The problem is there
doesn't seem to be support for an xs:extension.  There is some other
trickiness going on too, but anyone have experience with this?
Karl
 On Jan 5, 2012 7:59 PM, &quot;G. Ken Holman&quot; &lt;gkholman@cranesoftwrights.com&gt;
wrote:

&gt; At 2012-01-05 17:48 -0700, Karl Stubsjoen wrote:
&gt;
&gt;&gt; I have an element that extends a complex type but the additional
&gt;&gt; attribute with a simple type definition is not being enforced.  The
&gt;&gt; attribute is enforced, just not it's simple type.  Have I defined
&gt;&gt; something incorrectly?
&gt;&gt;
&gt;
&gt; I think this is one of those &quot;don't kick yourself&quot; problems.
&gt;
&gt;  Here they are:
&gt;&gt;
&gt;&gt; &lt;!-- to be used in extension below --&gt;
&gt;&gt;    &lt;xs:complexType name=&quot;ProjXm_QueryType&quot;&gt;
&gt;&gt;        &lt;xs:sequence&gt;
&gt;&gt;            &lt;xs:element ref=&quot;command&quot;/&gt;
&gt;&gt;            &lt;xs:element ref=&quot;parameters&quot;/&gt;
&gt;&gt;            &lt;xs:element ref=&quot;fields&quot; minOccurs=&quot;0&quot;/&gt;
&gt;&gt;        &lt;/xs:sequence&gt;
&gt;&gt;    &lt;/xs:complexType&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; &lt;!-- extends the above and adds a name attribute of specified simple type
&gt;&gt; --&gt;
&gt;&gt;    &lt;xs:element name=&quot;SharedDB&quot;&gt;
&gt;&gt;        &lt;xs:complexType&gt;
&gt;&gt;            &lt;xs:complexContent&gt;
&gt;&gt;                &lt;xs:extension base=&quot;ProjXm_QueryType&quot;&gt;
&gt;&gt;                    &lt;xs:attribute name=&quot;name&quot;
&gt;&gt; type=&quot;simpleType_**SharedDBQueries&quot; /&gt;
&gt;&gt;
&gt;
&gt; Here you've just augmented your element with an attribute ....
&gt;
&gt;                 &lt;/xs:extension&gt;
&gt;&gt;            &lt;/xs:complexContent&gt;
&gt;&gt;        &lt;/xs:complexType&gt;
&gt;&gt;    &lt;/xs:element&gt;
&gt;&gt;
&gt;&gt; &lt;!-- expected values for name attribute -&gt;
&gt;&gt;    &lt;xs:simpleType name=&quot;simpleType_**SharedDBQueries&quot;&gt;
&gt;&gt;        &lt;xs:restriction base=&quot;xs:NCName&quot;&gt;
&gt;&gt;            &lt;xs:enumeration value=&quot;insert&quot;/&gt;
&gt;&gt;            &lt;xs:enumeration value=&quot;update&quot;/&gt;
&gt;&gt;        &lt;/xs:restriction&gt;
&gt;&gt;    &lt;/xs:simpleType&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; &lt;!-- sample xml (snipped) --&gt;
&gt;&gt;    &lt;SharedDB&gt;
&gt;&gt;        &lt;command&gt;
&gt;&gt;            &lt;name&gt;insertxx&lt;/name&gt;&lt;!-- would expect validation to fail here
&gt;&gt; --&gt;
&gt;&gt;
&gt;
&gt; ... but you've put an element in your XML for testing.
&gt;
&gt;             &lt;type&gt;StoredProcedure&lt;/type&gt;
&gt;&gt;            &lt;action&gt;NonQuery&lt;/action&gt;
&gt;&gt;        &lt;/command&gt;
&gt;&gt;        &lt;parameters&gt;
&gt;&gt;    ...
&gt;&gt;    &lt;/SharedDB&gt;
&gt;&gt;
&gt;
&gt; I think if you had &lt;SharedDB name=&quot;insertxx&quot;&gt; you would find the problem
&gt; NCName flagged.  I just copied your exact schema fragment into a bogus
&gt; schema below and you'll see the attribute is being validated by both Xerces
&gt; and Saxon.
&gt;
&gt; I hope this helps.
&gt;
&gt; . . . . . . . . . . . . . Ken
&gt;
&gt; ~/t/ftemp $ cat karl.xsd
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;xs:schema xmlns:xs=&quot;http://www.w3.org/**2001/XMLSchema&lt;http://www.w3.org/2001/XMLSchema&gt;
&gt; &quot;
&gt;  elementFormDefault=&quot;qualified&quot;**&gt;
&gt;    &lt;!-- to be used in extension below --&gt;
&gt;    &lt;xs:complexType name=&quot;ProjXm_QueryType&quot;&gt;
&gt;        &lt;xs:sequence&gt;
&gt;            &lt;xs:element ref=&quot;command&quot;/&gt;
&gt;            &lt;xs:element ref=&quot;parameters&quot;/&gt;
&gt;            &lt;xs:element ref=&quot;fields&quot; minOccurs=&quot;0&quot;/&gt;
&gt;        &lt;/xs:sequence&gt;
&gt;    &lt;/xs:complexType&gt;
&gt;
&gt;
&gt; &lt;!-- extends the above and adds a name attribute of specified simple type
&gt; --&gt;
&gt;    &lt;xs:element name=&quot;SharedDB&quot;&gt;
&gt;        &lt;xs:complexType&gt;
&gt;            &lt;xs:complexContent&gt;
&gt;                &lt;xs:extension base=&quot;ProjXm_QueryType&quot;&gt;
&gt;                    &lt;xs:attribute name=&quot;name&quot;
&gt; type=&quot;simpleType_**SharedDBQueries&quot; /&gt;
&gt;                &lt;/xs:extension&gt;
&gt;            &lt;/xs:complexContent&gt;
&gt;        &lt;/xs:complexType&gt;
&gt;    &lt;/xs:element&gt;
&gt;
&gt; &lt;!-- expected values for name attribute --&gt;
&gt;    &lt;xs:simpleType name=&quot;simpleType_**SharedDBQueries&quot;&gt;
&gt;        &lt;xs:restriction base=&quot;xs:NCName&quot;&gt;
&gt;            &lt;xs:enumeration value=&quot;insert&quot;/&gt;
&gt;            &lt;xs:enumeration value=&quot;update&quot;/&gt;
&gt;        &lt;/xs:restriction&gt;
&gt;    &lt;/xs:simpleType&gt;
&gt;
&gt;    &lt;xs:element name=&quot;command&quot;&gt;
&gt;      &lt;xs:complexType/&gt;
&gt;    &lt;/xs:element&gt;
&gt;    &lt;xs:element name=&quot;fields&quot;&gt;
&gt;      &lt;xs:complexType/&gt;
&gt;    &lt;/xs:element&gt;
&gt;    &lt;xs:element name=&quot;parameters&quot;&gt;
&gt;      &lt;xs:complexType/&gt;
&gt;    &lt;/xs:element&gt;
&gt; &lt;/xs:schema&gt;
&gt; ~/t/ftemp $ cat karl.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;SharedDB name=&quot;insert&quot;&gt;
&gt;  &lt;command/&gt;
&gt;  &lt;parameters/&gt;
&gt; &lt;/SharedDB&gt;
&gt; ~/t/ftemp $ w3cschema karl.xsd karl.xml
&gt; Xerces...
&gt; Attempting validating, namespace-aware parse
&gt; Parse succeeded (0.131) with no errors and no warnings.
&gt; Saxon...
&gt; No validation errors
&gt; ~/t/ftemp $ cat karlbad1.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;SharedDB namex=&quot;insert&quot;&gt;
&gt;  &lt;command/&gt;
&gt;  &lt;parameters/&gt;
&gt; &lt;/SharedDB&gt;
&gt; ~/t/ftemp $ w3cschema karl.xsd karlbad1.xml
&gt; Xerces...
&gt; Attempting validating, namespace-aware parse
&gt; Error:file:///Users/admin/t/**ftemp/karlbad1.xml:2:26:cvc-**complex-type.3.2.2:
&gt; Attribute 'namex' is not allowed to appear in element 'SharedDB'.
&gt; Parse succeeded (0.135) with 1 error and no warnings.
&gt; Saxon...
&gt; Validation error on line 2 column 26 of karlbad1.xml:
&gt;  Attribute @namex is not allowed on element &lt;SharedDB&gt; (See
&gt;  http://www.w3.org/TR/**xmlschema-1/#cvc-complex-type&lt;http://www.w3.org/TR/xmlschema-1/#cvc-complex-type&gt;clause 3)
&gt; No validation errors
&gt; ~/t/ftemp $ cat karlbad2.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;SharedDB name=&quot;insertx&quot;&gt;
&gt;  &lt;command/&gt;
&gt;  &lt;parameters/&gt;
&gt; &lt;/SharedDB&gt;
&gt; ~/t/ftemp $ w3cschema karl.xsd karlbad2.xml
&gt; Xerces...
&gt; Attempting validating, namespace-aware parse
&gt; Error:file:///Users/admin/t/**ftemp/karlbad2.xml:2:26:cvc-**enumeration-valid:
&gt; Value 'insertx' is not facet-valid with respect to enumeration '[insert,
&gt; update]'. It must be a value from the enumeration.
&gt; Error:file:///Users/admin/t/**ftemp/karlbad2.xml:2:26:cvc-**attribute.3:
&gt; The value 'insertx' of attribute 'name' on element 'SharedDB' is not valid
&gt; with respect to its type, 'simpleType_SharedDBQueries'.
&gt; Parse succeeded (0.146) with 2 errors and no warnings.
&gt; Saxon...
&gt; Validation error on line 2 column 26 of karlbad2.xml:
&gt;  FORG0001: Value &quot;insertx&quot; contravenes the enumeration facet &quot;update,
&gt; insert&quot; of the type
&gt;  simpleType_SharedDBQueries (See http://www.w3.org/TR/**
&gt; xmlschema-1/#cvc-complex-type&lt;http://www.w3.org/TR/xmlschema-1/#cvc-complex-type&gt;clause 3)
&gt; No validation errors
&gt; ~/t/ftemp $
&gt;
&gt;
&gt; --
&gt; Contact us for world-wide XML consulting and instructor-led training
&gt; Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
&gt; Crane Softwrights Ltd.            http://www.CraneSoftwrights.**com/x/&lt;http://www.CraneSoftwrights.com/x/&gt;
&gt; G. Ken Holman                   mailto:gkholman@**CraneSoftwrights.com&lt;gkholman@CraneSoftwrights.com&gt;
&gt; Google+ profile: https://plus.google.com/**116832879756988317389/about&lt;https://plus.google.com/116832879756988317389/about&gt;
&gt; Legal business disclaimers:    http://www.CraneSoftwrights.**com/legal&lt;http://www.CraneSoftwrights.com/legal&gt;
&gt;
&gt;
&gt;</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324098.html</link>
</item><item>
<title>Re: SimpleType not enforced for extended element - 1/6/2012 2:59:00 AM</title>
<description><![CDATA[<pre>At 2012-01-05 17:48 -0700, Karl Stubsjoen wrote:
&gt;I have an element that extends a complex type but the additional
&gt;attribute with a simple type definition is not being enforced.  The
&gt;attribute is enforced, just not it's simple type.  Have I defined
&gt;something incorrectly?

I think this is one of those &quot;don't kick yourself&quot; problems.

&gt;Here they are:
&gt;
&gt;&lt;!-- to be used in extension below --&gt;
&gt;     &lt;xs:complexType name=&quot;ProjXm_QueryType&quot;&gt;
&gt;         &lt;xs:sequence&gt;
&gt;             &lt;xs:element ref=&quot;command&quot;/&gt;
&gt;             &lt;xs:element ref=&quot;parameters&quot;/&gt;
&gt;             &lt;xs:element ref=&quot;fields&quot; minOccurs=&quot;0&quot;/&gt;
&gt;         &lt;/xs:sequence&gt;
&gt;     &lt;/xs:complexType&gt;
&gt;
&gt;
&gt;&lt;!-- extends the above and adds a name attribute of specified simple type --&gt;
&gt;     &lt;xs:element name=&quot;SharedDB&quot;&gt;
&gt;         &lt;xs:complexType&gt;
&gt;             &lt;xs:complexContent&gt;
&gt;                 &lt;xs:extension base=&quot;ProjXm_QueryType&quot;&gt;
&gt;                     &lt;xs:attribute name=&quot;name&quot;
&gt;type=&quot;simpleType_SharedDBQueries&quot; /&gt;

Here you've just augmented your element with an attribute ....

&gt;                 &lt;/xs:extension&gt;
&gt;             &lt;/xs:complexContent&gt;
&gt;         &lt;/xs:complexType&gt;
&gt;     &lt;/xs:element&gt;
&gt;
&gt;&lt;!-- expected values for name attribute -&gt;
&gt;     &lt;xs:simpleType name=&quot;simpleType_SharedDBQueries&quot;&gt;
&gt;         &lt;xs:restriction base=&quot;xs:NCName&quot;&gt;
&gt;             &lt;xs:enumeration value=&quot;insert&quot;/&gt;
&gt;             &lt;xs:enumeration value=&quot;update&quot;/&gt;
&gt;         &lt;/xs:restriction&gt;
&gt;     &lt;/xs:simpleType&gt;
&gt;
&gt;
&gt;&lt;!-- sample xml (snipped) --&gt;
&gt;     &lt;SharedDB&gt;
&gt;         &lt;command&gt;
&gt;             &lt;name&gt;insertxx&lt;/name&gt;&lt;!-- would expect validation to 
&gt; fail here --&gt;

... but you've put an element in your XML for testing.

&gt;             &lt;type&gt;StoredProcedure&lt;/type&gt;
&gt;             &lt;action&gt;NonQuery&lt;/action&gt;
&gt;         &lt;/command&gt;
&gt;         &lt;parameters&gt;
&gt;     ...
&gt;     &lt;/SharedDB&gt;

I think if you had &lt;SharedDB name=&quot;insertxx&quot;&gt; you would find the 
problem NCName flagged.  I just copied your exact schema fragment 
into a bogus schema below and you'll see the attribute is being 
validated by both Xerces and Saxon.

I hope this helps.

. . . . . . . . . . . . . Ken

~/t/ftemp $ cat karl.xsd
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
   elementFormDefault=&quot;qualified&quot;&gt;
     &lt;!-- to be used in extension below --&gt;
     &lt;xs:complexType name=&quot;ProjXm_QueryType&quot;&gt;
         &lt;xs:sequence&gt;
             &lt;xs:element ref=&quot;command&quot;/&gt;
             &lt;xs:element ref=&quot;parameters&quot;/&gt;
             &lt;xs:element ref=&quot;fields&quot; minOccurs=&quot;0&quot;/&gt;
         &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;


&lt;!-- extends the above and adds a name attribute of specified simple type --&gt;
     &lt;xs:element name=&quot;SharedDB&quot;&gt;
         &lt;xs:complexType&gt;
             &lt;xs:complexContent&gt;
                 &lt;xs:extension base=&quot;ProjXm_QueryType&quot;&gt;
                     &lt;xs:attribute name=&quot;name&quot;
type=&quot;simpleType_SharedDBQueries&quot; /&gt;
                 &lt;/xs:extension&gt;
             &lt;/xs:complexContent&gt;
         &lt;/xs:complexType&gt;
     &lt;/xs:element&gt;

&lt;!-- expected values for name attribute --&gt;
     &lt;xs:simpleType name=&quot;simpleType_SharedDBQueries&quot;&gt;
         &lt;xs:restriction base=&quot;xs:NCName&quot;&gt;
             &lt;xs:enumeration value=&quot;insert&quot;/&gt;
             &lt;xs:enumeration value=&quot;update&quot;/&gt;
         &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;

     &lt;xs:element name=&quot;command&quot;&gt;
       &lt;xs:complexType/&gt;
     &lt;/xs:element&gt;
     &lt;xs:element name=&quot;fields&quot;&gt;
       &lt;xs:complexType/&gt;
     &lt;/xs:element&gt;
     &lt;xs:element name=&quot;parameters&quot;&gt;
       &lt;xs:complexType/&gt;
     &lt;/xs:element&gt;
&lt;/xs:schema&gt;
~/t/ftemp $ cat karl.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;SharedDB name=&quot;insert&quot;&gt;
   &lt;command/&gt;
   &lt;parameters/&gt;
&lt;/SharedDB&gt;
~/t/ftemp $ w3cschema karl.xsd karl.xml
Xerces...
Attempting validating, namespace-aware parse
Parse succeeded (0.131) with no errors and no warnings.
Saxon...
No validation errors
~/t/ftemp $ cat karlbad1.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;SharedDB namex=&quot;insert&quot;&gt;
   &lt;command/&gt;
   &lt;parameters/&gt;
&lt;/SharedDB&gt;
~/t/ftemp $ w3cschema karl.xsd karlbad1.xml
Xerces...
Attempting validating, namespace-aware parse
Error:file:///Users/admin/t/ftemp/karlbad1.xml:2:26:cvc-complex-type.3.2.2: 
Attribute 'namex' is not allowed to appear in element 'SharedDB'.
Parse succeeded (0.135) with 1 error and no warnings.
Saxon...
Validation error on line 2 column 26 of karlbad1.xml:
   Attribute @namex is not allowed on element &lt;SharedDB&gt; (See
   http://www.w3.org/TR/xmlschema-1/#cvc-complex-type clause 3)
No validation errors
~/t/ftemp $ cat karlbad2.xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;SharedDB name=&quot;insertx&quot;&gt;
   &lt;command/&gt;
   &lt;parameters/&gt;
&lt;/SharedDB&gt;
~/t/ftemp $ w3cschema karl.xsd karlbad2.xml
Xerces...
Attempting validating, namespace-aware parse
Error:file:///Users/admin/t/ftemp/karlbad2.xml:2:26:cvc-enumeration-valid: 
Value 'insertx' is not facet-valid with respect to enumeration 
'[insert, update]'. It must be a value from the enumeration.
Error:file:///Users/admin/t/ftemp/karlbad2.xml:2:26:cvc-attribute.3: 
The value 'insertx' of attribute 'name' on element 'SharedDB' is not 
valid with respect to its type, 'simpleType_SharedDBQueries'.
Parse succeeded (0.146) with 2 errors and no warnings.
Saxon...
Validation error on line 2 column 26 of karlbad2.xml:
   FORG0001: Value &quot;insertx&quot; contravenes the enumeration facet 
&quot;update, insert&quot; of the type
   simpleType_SharedDBQueries (See 
http://www.w3.org/TR/xmlschema-1/#cvc-complex-type clause 3)
No validation errors
~/t/ftemp $


--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 &amp; 2.0 http://ude.my/uoui9h
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324094.html</link>
</item><item>
<title>SimpleType not enforced for extended element - 1/6/2012 12:50:00 AM</title>
<description><![CDATA[<pre>I have an element that extends a complex type but the additional
attribute with a simple type definition is not being enforced. &#160;The
attribute is enforced, just not it's simple type. &#160;Have I defined
something incorrectly? &#160;Here they are:

&lt;!-- to be used in extension below --&gt;
&#160; &#160; &lt;xs:complexType name=&quot;ProjXm_QueryType&quot;&gt;
&#160; &#160; &#160; &#160; &lt;xs:sequence&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:element ref=&quot;command&quot;/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:element ref=&quot;parameters&quot;/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:element ref=&quot;fields&quot; minOccurs=&quot;0&quot;/&gt;
&#160; &#160; &#160; &#160; &lt;/xs:sequence&gt;
&#160; &#160; &lt;/xs:complexType&gt;


&lt;!-- extends the above and adds a name attribute of specified simple type --&gt;
&#160; &#160; &lt;xs:element name=&quot;SharedDB&quot;&gt;
&#160; &#160; &#160; &#160; &lt;xs:complexType&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:complexContent&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:extension base=&quot;ProjXm_QueryType&quot;&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:attribute name=&quot;name&quot;
type=&quot;simpleType_SharedDBQueries&quot; /&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;/xs:extension&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;/xs:complexContent&gt;
&#160; &#160; &#160; &#160; &lt;/xs:complexType&gt;
&#160; &#160; &lt;/xs:element&gt;

&lt;!-- expected values for name attribute -&gt;
&#160; &#160; &lt;xs:simpleType name=&quot;simpleType_SharedDBQueries&quot;&gt;
&#160; &#160; &#160; &#160; &lt;xs:restriction base=&quot;xs:NCName&quot;&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:enumeration value=&quot;insert&quot;/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;xs:enumeration value=&quot;update&quot;/&gt;
&#160; &#160; &#160; &#160; &lt;/xs:restriction&gt;
&#160; &#160; &lt;/xs:simpleType&gt;


&lt;!-- sample xml (snipped) --&gt;
&#160; &#160; &lt;SharedDB&gt;
&#160; &#160; &#160; &#160; &lt;command&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;name&gt;insertxx&lt;/name&gt;&lt;!-- would expect validation to fail here --&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;type&gt;StoredProcedure&lt;/type&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;action&gt;NonQuery&lt;/action&gt;
&#160; &#160; &#160; &#160; &lt;/command&gt;
&#160; &#160; &#160; &#160; &lt;parameters&gt;
&#160; &#160; ...
&#160; &#160; &lt;/SharedDB&gt;


Thanks,
Karl..</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201201/msg1000324091.html</link>
</item><item>
<title>Online validator and *.wikipedia.org - 12/27/2011 5:57:00 AM</title>
<description><![CDATA[<pre>Hi,

trying to use the online validator on Wikipedia XML docu-
ments and schemas (cf.
&lt;URI:http://www.w3.org/2001/03/webdata/xsv?docAddrs=http://de.wikipedia.org/w/index.php?title=Vorlage:Infobox_Ort_in_Griechenland/XML%26action%3Draw+http://de.wikipedia.org/w/index.php?title=User:Revvar/VM/XML-Schema%26action%3Draw&amp;warnings=on&amp;style=xsl&gt;)
yields:

| validator crash during target reading
| Error: can't retrieve &quot;http://de.wikipedia.org/w/index.php?title=Vorlage:Infobox_Ort_in_Griechenland/XML&amp;action=raw&quot;: 403 Forbidden

This (&quot;403 Forbidden&quot;) is most probably due to the online
validator not supplying a &quot;User-Agent&quot; header (or using a
default one too common) and thus being rejected by Wikipe-
dia; this policy is explained a bit at
&lt;URI:http://www.mediawiki.org/wiki/API%3aFAQ#do_I_get_HTTP_403_errors.3F&gt;.

  So - if this is the case - it would be nice if the online
validator could provide a suitable &quot;User-Agent&quot; header.
Some information on how to achieve that with Python is
available inter alia at
&lt;URI:http://stackoverflow.com/questions/120061/fetch-a-wikipedia-article-with-python&gt;.

Thanks in advance,
Tim

P. S.: There's also a typo in &quot;report problems (and
       sucesses!) to xmlschema-dev (archive)&quot; :-).</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323884.html</link>
</item><item>
<title>Re: [xml] libxml2 does xmlSchemaValidateDoc() support xml schema  - 12/18/2011 12:24:00 PM</title>
<description><![CDATA[<pre>Piotr Sipika wrote:

&gt; 
&gt; [] to compile:
&gt; $ gcc `xml2-config --cflags --libs` zoo.c -o zoo
&gt; 

No, this is wrong command line order.  Specifying the libraries before
the objects has always been wrong even though it has worked on Linux it
will never work on Windows or other environments.  Instead

$ gcc `xml2-config --cflags` zoo.c -o zoo `xml2-config --libs`

or even

$ gcc zoo.c -o zoo `xml2-config --cflags --libs`

since the compile flags are not position dependent but the library
specifications are.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd/</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323816.html</link>
</item><item>
<title>Re: libxml2  does xmlSchemaValidateDoc()  support xml schema  - 12/17/2011 2:23:00 AM</title>
<description><![CDATA[<pre>Many thanks Piotr

Happy Holidays

Andy


On Dec 15, 2011, at 7:01 PM, Piotr Sipika wrote:

&gt; Hi Andy,
&gt; 
&gt;&gt; I am setting up the xml schema namespace the same way eclipse does when
&gt;&gt; you create a new XSD or XML file. I entered
&gt;&gt; *http://www.w3.org/2001/XMLSchema-instance*in the address bar of my
&gt;&gt; browsers and got quite a surprise!
&gt;&gt; 
&gt; The XML Namespace spec(1) states that the namespace URI need not be a
&gt; valid URL (i.e. point to a valid document on the network). In other
&gt; words, you are declaring your namespaces correctly.
&gt; 
&gt;&gt; http://www.w3.org/TR/xmlschema-1/#no-xsi is very confusing. 
&gt; If you look at section 3.2.7 (first table) at that location, you'll see
&gt; that using 'xsi:type' is perfectly fine.
&gt; 
&gt;&gt; where does libxml get the schema lang schema/dtd? As a test I put some
&gt;&gt; typos in my xsd file. libxml generated an error when I tried to validate
&gt;&gt; the xsd file as expected?
&gt; You don't have to worry about libxml retrieving resources at namespace
&gt; locations, that does not happen. Only the actual URI string matters (as
&gt; per (1)).
&gt; 
&gt;&gt; what URL should I be using?
&gt;&gt; 
&gt;&gt; Do I need to make a special call to cause the libxml to use this other
&gt;&gt; location?
&gt; Nope, you're using the right URIs, no network access is necessary.
&gt; 
&gt;&gt; Would you be willing to send my your sample C program? 
&gt; Sure thing (I should have done so in my original reply).
&gt; 
&gt; [] to compile:
&gt; $ gcc `xml2-config --cflags --libs` zoo.c -o zoo
&gt; 
&gt; [] sample run:
&gt; $ ./zoo zoo.xml ZooRequest.xsd
&gt; Attempting to validate zoo.xml with ZooRequest.xsd
&gt; Document in zoo.xml is valid
&gt; 
&gt; [] contents of zoo.xml:
&gt; $ cat zoo.xml
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;zoo:cageRequest xmlns:zoo=&quot;http://www.example.org/Zoo&quot;
&gt;                 xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
&gt;  &lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
&gt;    &lt;name&gt;Blue Fin Tuna&lt;/name&gt;
&gt;    &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
&gt;  &lt;/animal&gt;
&gt; &lt;/zoo:cageRequest&gt;
&gt; 
&gt; Hope you get things sorted out.
&gt; 
&gt; Piotr
&gt; 
&gt; 
&gt; (1) - http://www.w3.org/TR/REC-xml-names/#ns-decl
&gt; &lt;zoo.c&gt;</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323795.html</link>
</item><item>
<title>Re: libxml2  does xmlSchemaValidateDoc()  support xml schema  - 12/16/2011 3:05:00 AM</title>
<description><![CDATA[<pre>/** 
 * Sample namespace XSD validation program. 
 * Released into public domain.
 * Piotr Sipika
 */

#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;

#include &lt;libxml/xmlschemas.h&gt;
#include &lt;libxml/parser.h&gt;
#include &lt;libxml/tree.h&gt;

int
main(int argc, char * argv[])
{
  if (argc != 3)
    {
      fprintf(stderr, &quot;Need file name and schema file name\n&quot;);

      return EXIT_FAILURE;
    }

  const char *pczFile = argv[1];
  const char *pczSchema = argv[2];

  xmlInitParser();

  xmlDocPtr pDoc = xmlReadFile(pczFile, NULL, XML_PARSE_NONET);

  if (!pDoc)
    {
      fprintf(stderr, &quot;Unable to read %s\n&quot;, pczFile);

      xmlCleanupParser();

      return EXIT_FAILURE;
    }

  xmlDocPtr pSchemaDoc = xmlReadFile(pczSchema, NULL, XML_PARSE_NONET);

  if (!pSchemaDoc)
    {
      fprintf(stderr, &quot;Unable to read %s\n&quot;, pczSchema);

      xmlFreeDoc(pDoc);

      xmlCleanupParser();

      return EXIT_FAILURE;
    }

  // create actual schema
  xmlSchemaParserCtxtPtr pSchemaCtxt = xmlSchemaNewDocParserCtxt(pSchemaDoc);

  if (!pSchemaCtxt)
    {
      fprintf(stderr, &quot;Unable to create schema context\n&quot;);

      xmlFreeDoc(pDoc);

      xmlFreeDoc(pSchemaDoc);

      xmlCleanupParser();

      return EXIT_FAILURE;
    }

  xmlSchemaPtr pSchema = xmlSchemaParse(pSchemaCtxt);

  if (!pSchema)
    {
      fprintf(stderr, &quot;Unable to create schema\n&quot;);

      xmlSchemaFreeParserCtxt(pSchemaCtxt);

      xmlFreeDoc(pDoc);

      xmlFreeDoc(pSchemaDoc);

      xmlCleanupParser();

      return EXIT_FAILURE;
    }

  xmlSchemaValidCtxtPtr pValidCtxt = xmlSchemaNewValidCtxt(pSchema);

  if (!pValidCtxt)
    {
      fprintf(stderr, &quot;Unable to create validity context for schema\n&quot;);

      xmlSchemaFree(pSchema);

      xmlSchemaFreeParserCtxt(pSchemaCtxt);

      xmlFreeDoc(pDoc);

      xmlFreeDoc(pSchemaDoc);

      xmlCleanupParser();

      return EXIT_FAILURE;
    }

  fprintf(stdout, &quot;Attempting to validate %s with %s\n&quot;, pczFile, pczSchema);

  xmlSchemaFreeParserCtxt(pSchemaCtxt);

  xmlFreeDoc(pSchemaDoc);

  int iError = xmlSchemaValidateDoc(pValidCtxt, pDoc);

  if (iError == 0)
    {
      fprintf(stdout, &quot;Document in %s is valid\n&quot;, pczFile);
    }
  else
    {
      fprintf(stdout, &quot;Document in %s is NOT valid\n&quot;, pczFile);
    }

  xmlSchemaFree(pSchema);
  
  //  xmlSchemaFreeParserCtxt(pSchemaCtxt);
  
  xmlFreeDoc(pDoc);
  
  //  xmlFreeDoc(pSchemaDoc);
  
  xmlCleanupParser();
                               
  return EXIT_SUCCESS;
}</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323782.html</link>
</item><item>
<title>Re: libxml2  does xmlSchemaValidateDoc()  support xml schema  - 12/15/2011 11:47:00 PM</title>
<description><![CDATA[<pre>Hi Piortr


I still can not validate xml that uses xml schema extensions. I think I figured out what the problem might be, but do not know how to resolve i. I wonder if the problem is with the way I set up my xml namespace?

&lt;zoo:cageRequest xmlns:zoo=&quot;http://www.example.org/Zoo&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;

I am setting up the xml schema namespace the same way eclipse does when you create a new XSD or XML file. I entered http://www.w3.org/2001/XMLSchema-instance in the address bar of my browsers and got quite a surprise!
 &lt;xs:annotation&gt;
  &lt;xs:documentation&gt;&lt;p&gt;This schema should never be used as such:
                    &lt;a href=&quot;http://www.w3.org/TR/xmlschema-1/#no-xsi&quot;&gt;the XML
                    Schema Recommendation&lt;/a&gt; forbids the declaration of
                    attributes in this namespace&lt;/p&gt;
  &lt;/xs:documentation&gt;
 &lt;/xs:annotation&gt;
http://www.w3.org/TR/xmlschema-1/#no-xsi is very confusing. 

where does libxml get the schema lang schema/dtd? As a test I put some typos in my xsd file. libxml generated an error when I tried to validate the xsd file as expected?

what URL should I be using?

Do I need to make a special call to cause the libxml to use this other location?

My app will be running on a private network and not have access to www.w3.org, Do I need to copy a dtd or something to my local env?

thanks in advance

Andy



p.s. Bellow is a long email I was going to send before I got the surprise I mentioned above. There is a nice code example of how how to validate. Its much simpler than the other examples I have seen posted in the past


On Dec 13, 2011, at 7:19 AM, Piotr Sipika wrote:
&gt; 
&gt; I wrote a sample program (in C) to attempt to mimic what you have, and
&gt; was able to successfully validate the instance against the schema you
&gt; provided.
&gt; 

Would you be willing to send my your sample C program? 

I must be missing a function call somewhere?  My XML/XSD files that do not use extensions validate so I think my basic code structure is correct. In your original post you mentioned &quot;xmllint&quot;. I did not know about that tool. All of my files validate according to xmllint.I stepped through xmllint to see how it worked. Its very complicated. I must have missed something. Looking at the xmllint source I was able to simplify my code and get rid some some memory leaks.

Here is my simplified code listing based on the xmllint source

   const char *schemaFileNameStr = ...;
    
    // http://xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaNewParserCtxt
    xmlSchemaParserCtxtPtr ctxt = xmlSchemaNewParserCtxt(schemaFileNameStr);
    
     //http://xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaSetParserErrors
    xmlSchemaSetParserErrors(ctxt,
                             (xmlSchemaValidityErrorFunc) fprintf,
                             (xmlSchemaValidityWarningFunc) fprintf,
                             stderr);
    
	xmlSchemaPtr wxschemas = xmlSchemaParse(ctxt);
	if (wxschemas == NULL) {
	    NSLog(@&quot;******* ERROR schema %@ failed to compile\n&quot;, xmlSchemaFilePath);
	    return ret; 
	}
	xmlSchemaFreeParserCtxt(ctx);

	for (all the xml files) {
   	// http://www.xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaNewValidCtxt
    	xmlSchemaValidCtxtPtr vctxt = xmlSchemaNewValidCtxt(wxschemas);
    
    	// http://xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaSetValidErrors
		xmlSchemaSetValidErrors(vctxt,
                            (xmlSchemaValidityErrorFunc) fprintf,
                            (xmlSchemaValidityWarningFunc) fprintf,
                            stderr);
    
    	// http://xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaValidateDoc
		int error = xmlSchemaValidateDoc(vctxt, doc);
		if (error == 0) {
        		ret = YES;
		} else if (error &gt; 0) {
        		ret = NO;
	    		fprintf(stderr, &quot;%s fails to validate\n&quot;, filename);
		} else {
        		ret = NO; // validation generated an internal error
		}
    
		xmlSchemaFreeValidCtxt(vctxt);
	}


&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;zoo:cageRequest xmlns:zoo=&quot;http://www.example.org/Zoo&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
  &lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
    &lt;name&gt;Blue Fin Tuna&lt;/name&gt;
    &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
  &lt;/animal&gt;
&lt;/zoo:cageRequest&gt;


element animal: Schemas validity error : Element 'animal', attribute 'xsi:type': The attribute 'xsi:type' is not allowed.
element numberOfFins: Schemas validity error : Element 'numberOfFins': This element is not expected.

DOCUMENT
version=1.0
standalone=true
  ELEMENT zoo:cageRequest
    namespace zoo href=http://www.example.org/Zoo
    namespace xsi href=http://www.w3.org/2001/XMLSchema-instanc...
    ELEMENT animal
      ATTRIBUTE xsi:type
        TEXT
          content=zoo:Fish
      ELEMENT name
        TEXT
          content=Blue Fin Tuna
      ELEMENT numberOfFins
        TEXT
          content=4</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323779.html</link>
</item><item>
<title>Re: Add import elements to a schema with no change of functionality? - 12/15/2011 11:36:00 AM</title>
<description><![CDATA[<pre>On 15/12/2011 10:40, Costello, Roger L. wrote:
&gt; Hi Folks,
&gt;
&gt; Consider a schema, S1, with targetNamespace, tns1.
&gt;
&gt; Schema S2 has targetNamespace tns2, where tns1 is not equal to tns2.
Schemas do not have a target namespace. I think you are referring to 
schema documents.
&gt;
&gt; And so forth.
&gt;
&gt; S1 imports S2 which imports S3 which ...
&gt;
&gt; There are N schemas.
No, there is one schema. There are N schema documents.
&gt;
&gt; S1 has only one import element -- it imports S2.
&gt;
&gt; Suppose I add to S1 import elements to S3, S4, ..., Sn.
If S1 was already a valid schema document, then it contained no 
references to components defined in S3, S4, etc, and therefore the new 
import declarations are redundant, and therefore the schema constructed 
from this collection of schema documents is not affected. (It's very 
much the same as adding an &quot;import&quot; in a Java source file for a class or 
package that isn't then referenced from the code.)

However, the schema construction model is not defined very formally, and 
many aspects are implementation-defined, so your mileage may vary.

Michael Kay
Saxonica</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323767.html</link>
</item><item>
<title>Add import elements to a schema with no change of functionality? - 12/15/2011 10:45:00 AM</title>
<description><![CDATA[<pre>Hi Folks,

Consider a schema, S1, with targetNamespace, tns1.

Schema S2 has targetNamespace tns2, where tns1 is not equal to tns2.

And so forth.

S1 imports S2 which imports S3 which ...

There are N schemas.

S1 has only one import element -- it imports S2.

Suppose I add to S1 import elements to S3, S4, ..., Sn.

And make no other changes to S1.

Let S1' be the altered S1.

Is S1' = S1?

Does S1' have the same functionality as S1?

/Roger</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323766.html</link>
</item><item>
<title>Re: Fwd: libxml2  does xmlSchemaValidateDoc()  support xml schema  - 12/13/2011 3:27:00 PM</title>
<description><![CDATA[<pre>On 12/12/2011 09:12 PM, Andy Davidson wrote:
&gt; Does anyone know if libxml2
&gt; supports  http://www.w3.org/TR/xmlschema-0/#DerivExt   ?
&gt; 
Yes, it does.

The rest of the message was libxml2-specific, so I took the liberty of
replying to it and 'returning' it to the libxml2 mailing list.

P</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323729.html</link>
</item><item>
<title>Fwd: libxml2  does xmlSchemaValidateDoc()  support xml schema  - 12/13/2011 2:14:00 AM</title>
<description><![CDATA[<pre>Does anyone know if libxml2 supports  http://www.w3.org/TR/xmlschema-0/#DerivExt   ?

thanks in advance

Andy

Begin forwarded message:

&gt; From: Andy Davidson &lt;andy_davidson@apple.com&gt;
&gt; Date: December 12, 2011 6:10:14 PM PST
&gt; To: xml@gnome.org
&gt; Subject: libxml2 does xmlSchemaValidateDoc() support xml schema extensions?
&gt; 
&gt; Hi
&gt; 
&gt; I am using libxml2. I use xmlSchemaValidateDoc() to make sure my xml is valid. Recently we started using Extension to define new complexTypes.
&gt; 
&gt; The description for extensions can be found at http://www.w3.org/TR/xmlschema-0/#DerivExt  
&gt; 
&gt; These instance do not validate using libxml2. I am able to validate these instance using java version &quot;1.6.0_29&quot;
&gt; 
&gt; 
&gt; Attached is my test Zoo.xsd, and the instance I am trying to validate
&gt; 
&gt; 
&gt; 
&gt; 
&gt;     &lt;complexType name=&quot;Animal&quot;&gt;
&gt;         &lt;sequence&gt;
&gt;             &lt;element name=&quot;name&quot; type=&quot;string&quot; /&gt;
&gt;         &lt;/sequence&gt;
&gt;     &lt;/complexType&gt;
&gt; 
&gt;     &lt;complexType name=&quot;Fish&quot;&gt;
&gt;         &lt;complexContent&gt;
&gt;             &lt;extension base=&quot;zoo:Animal&quot;&gt;
&gt;                 &lt;sequence&gt;
&gt;                     &lt;element name=&quot;numberOfFins&quot; type=&quot;integer&quot; /&gt;
&gt;                 &lt;/sequence&gt;
&gt;             &lt;/extension&gt;
&gt;         &lt;/complexContent&gt;
&gt;     &lt;/complexType&gt;
&gt; 
&gt; My xml instance is 
&gt; 
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;zoo:cageRequest xmlns:zoo=&quot;http://www.example.org/Zoo&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
&gt;   &lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
&gt;     &lt;name&gt;Blue Fin Tuna&lt;/name&gt;
&gt;     &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
&gt;   &lt;/animal&gt;
&gt; &lt;/zoo:cageRequest&gt;
&gt; 
&gt; xmlSchemaValidateDoc() generates the following output
&gt; element animal: Schemas validity error : Element 'animal', attribute 'xsi:type': The attribute 'xsi:type' is not allowed.
&gt; element numberOfFins: Schemas validity error : Element 'numberOfFins': This element is not expected.
&gt; 
&gt; the error returned is  1871 for instance
&gt; 
&gt; xmlDebugDumpDocument() produces
&gt; 
&gt; DOCUMENT
&gt; version=1.0
&gt; standalone=true
&gt;   ELEMENT zoo:cageRequest
&gt;     namespace zoo href=http://www.example.org/Zoo
&gt;     namespace xsi href=http://www.w3.org/2001/XMLSchema-instanc...
&gt;     ELEMENT animal
&gt;       ATTRIBUTE xsi:type
&gt;         TEXT
&gt;           content=zoo:Fish
&gt;       ELEMENT name
&gt;         TEXT
&gt;           content=Blue Fin Tuna
&gt;       ELEMENT numberOfFins
&gt;         TEXT
&gt;           content=4
&gt; (gdb) 
&gt; 
&gt; 
&gt; Do I need to tweak my validation code ? 
&gt; 
&gt; 
&gt; (this is an ObjC listing)
&gt; 
&gt;     
&gt;     
&gt;     const char *schemaFileNameStr = [xmlSchemaFilePath cStringUsingEncoding: NSASCIIStringEncoding];
&gt;     
&gt;     // http://www.xmlsoft.org/html/libxml-parser.html#xmlReadFile
&gt;     // second arg, null, is document encoding
&gt;     // XML_PARSE_NONET option means &quot;Forbid network access&quot;
&gt;     xmlDocPtr schemaDoc = xmlReadFile(schemaFileNameStr, NULL, XML_PARSE_NONET);
&gt;     NSString *errorMsgRoot = @&quot;**** ERROR: POSXMLSchemaValidator.m createAndAddValidatorFor:, &quot;;
&gt;     if (schemaDoc == NULL) {
&gt;         /* the schema cannot be loaded or is not well-formed */
&gt;         NSLog(@&quot;%@ the schema: %s can not be loaded or is not well-formed&quot;, errorMsgRoot, schemaFileNameStr);
&gt;         return ret;
&gt;     }
&gt;     
&gt;     // http://www.xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaNewDocParserCtxt
&gt;     xmlSchemaParserCtxtPtr parserCtxt = xmlSchemaNewDocParserCtxt(schemaDoc);
&gt;     if (parserCtxt == NULL) {
&gt;         /* unable to create a parser context for the schema */
&gt;         xmlFreeDoc(schemaDoc);
&gt;         NSLog(@&quot;%@ unable to create a parser context for schema %s&quot;, errorMsgRoot, schemaFileNameStr);
&gt;         return ret;
&gt;     }
&gt;     
&gt;     // http://www.xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaParse
&gt;     xmlSchemaPtr schema = xmlSchemaParse(parserCtxt);
&gt;     if (schema == NULL) {
&gt;         /* the schema itself is not valid */
&gt;         xmlSchemaFreeParserCtxt(parserCtxt);
&gt;         xmlFreeDoc(schemaDoc);
&gt;         NSLog(@&quot;%@ the schema %s is not valid&quot;, errorMsgRoot, schemaFileNameStr);
&gt;         return ret;
&gt;     }
&gt;     
&gt;     // http://www.xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaNewValidCtxt
&gt;     xmlSchemaValidCtxtPtr validCtxt = xmlSchemaNewValidCtxt(schema);
&gt;     if (validCtxt == NULL) {
&gt;         /* unable to create a validation context for the schema */
&gt;         xmlSchemaFree(schema);
&gt;         xmlSchemaFreeParserCtxt(parserCtxt);
&gt;         xmlFreeDoc(schemaDoc);
&gt;         NSLog(@&quot;%@ unable to validation context for schema %s&quot;, errorMsgRoot, schemaFileNameStr);
&gt;         return ret; 
&gt;     }
&gt;     
&gt;     //xmlSchemaFree(schema); causes crash when we try to use validCtxt
&gt;     xmlSchemaFreeParserCtxt(parserCtxt);
&gt;     xmlFreeDoc(schemaDoc);
&gt;     
&gt;     // http://www.xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaValidateDoc
&gt;     int error = xmlSchemaValidateDoc(validCtxt.validCtxt, doc);             
&gt;     if (error == 0) {
&gt;         NSLog(@&quot;document is a valid instance of %@&quot;, schemaFileName);
&gt;         ret = YES;
&gt;     } 
&gt;     
&gt; 
&gt; Is this a bug?
&gt; 
&gt; thanks in advance
&gt; 
&gt; Andy
&gt;</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323711.html</link>
</item><item>
<title>Re: what is the correct for xpath selector for xsi:type - 12/12/2011 12:33:00 PM</title>
<description><![CDATA[<pre>I think that this is a namespace issue.  You will need to register the 
&quot;xsi&quot; namespace to the libXML2 engine and then use its prefix in your 
XPath expressions.

The way to do that varies by language.



On 12/08/2011 06:08 PM, Andy Davidson wrote:
&gt; Hi
&gt;
&gt; I am trying use libxml2 to parse the following xml.
&gt;
&gt; &lt;?xmlversion=&quot;1.0&quot;encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;zoo:cageRequest
&gt; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
&gt; xmlns:zoo=&quot;http://www.example.org/Zoo&quot;
&gt; xsi:schemaLocation=&quot;http://www.example.org/Zoo ../XSD/ZooRequest.xsd &quot;&gt;
&gt; &lt;animalxsi:type=&quot;zoo:Fish&quot;&gt;
&gt; &lt;name&gt;tuna&lt;/name&gt;
&gt; &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
&gt; &lt;/animal&gt;
&gt; &lt;/zoo:cageRequest&gt;
&gt;
&gt; I need to do some special processing based on the value of xsi:type. 
&gt;  I eventual get a a xmlNodePtr that points to
&gt;
&gt; &lt;animalxsi:type=&quot;zoo:Fish&quot;&gt;
&gt; &lt;name&gt;tuna&lt;/name&gt;
&gt; &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
&gt; &lt;/animal&gt;
&gt;
&gt; I can not seem to select the attribute. &quot;@*&quot; works but is not going to 
&gt; work long term.
&gt;
&gt; &quot;@xsi:type&quot; and &quot;@type&quot; did not work
&gt;
&gt; thanks
&gt;
&gt; Andy</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323686.html</link>
</item><item>
<title>Re: what is the correct for xpath selector for xsi:type - 12/12/2011 12:33:00 PM</title>
<description><![CDATA[<pre>On 12/08/2011 09:58 PM, Liam R E Quin wrote:
&gt; Since libxml is stuck on XPath 1, you can use explicit xsi:type
&gt; attributes but not type annotations that result from schema validation
&gt; episodes - you'd need an XPath 2 engine for that, such as Saxon.
&gt; 
&gt;&gt;   I eventual get a a xmlNodePtr that points to   
&gt;&gt;
&gt;&gt; &lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
&gt;&gt;       &lt;name&gt;tuna&lt;/name&gt;
&gt;&gt;       &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
&gt;&gt;   &lt;/animal&gt;
&gt;&gt;
&gt;&gt; I can not seem to select the attribute. &quot;@*&quot; works but is not going to work long term.
&gt;&gt;
&gt;&gt; &quot;@xsi:type&quot; and &quot;@type&quot; did not work
&gt; 
&gt; You need to bind the prefix xsi to the right URI in the namespace
&gt; context before evaluating the expression. Google for xpath and
&gt; namespaces. Then you can use @xsi:type.

As Liam wrote, you'll need to register all the namespaces you intend to
use in your XPath searches with the XPath context. The code would look
something like:

xmlXPathContextPtr pContext = xmlXPathNewContext(pDoc);
....
if (xmlXPathRegisterNs(pContext,
          (xmlChar*)&quot;xsi&quot;,
          (xmlChar*)&quot;http://www.w3.org/2001/XMLSchema-instance&quot;) != 0)
    {
      fprintf(stderr, &quot;Failed to register xsi\n&quot;);
    }

if (xmlXPathRegisterNs(pContext,
                     (xmlChar*)&quot;zoo&quot;,
                     (xmlChar*)&quot;http://www.example.org/Zoo&quot;) != 0)
    {
      fprintf(stderr, &quot;Failed to register zoo\n&quot;);
    }

 xmlXPathObjectPtr pObj = xmlXPathEvalExpression(pzXPath, pContext);

//etc...

The pertinent libxml2 example can be found here:
http://www.xmlsoft.org/examples/xpath1.c

Hope this helps.

P</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323687.html</link>
</item><item>
<title>Re: what is the correct for xpath selector for xsi:type - 12/9/2011 3:01:00 AM</title>
<description><![CDATA[<pre>On Thu, 2011-12-08 at 17:08 -0800, Andy Davidson wrote:
&gt; Hi
&gt; 
&gt; I am trying use libxml2 to parse the following xml. 
&gt; 
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&gt; &lt;zoo:cageRequest
&gt;     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
&gt;     xmlns:zoo=&quot;http://www.example.org/Zoo&quot;
&gt;     xsi:schemaLocation=&quot;http://www.example.org/Zoo ../XSD/ZooRequest.xsd &quot;&gt;
&gt;   &lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
&gt;       &lt;name&gt;tuna&lt;/name&gt;
&gt;       &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
&gt;   &lt;/animal&gt;
&gt; &lt;/zoo:cageRequest&gt;
&gt; 
&gt; I need to do some special processing based on the value of xsi:type.

Since libxml is stuck on XPath 1, you can use explicit xsi:type
attributes but not type annotations that result from schema validation
episodes - you'd need an XPath 2 engine for that, such as Saxon.

&gt;   I eventual get a a xmlNodePtr that points to   
&gt; 
&gt; &lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
&gt;       &lt;name&gt;tuna&lt;/name&gt;
&gt;       &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
&gt;   &lt;/animal&gt;
&gt; 
&gt; I can not seem to select the attribute. &quot;@*&quot; works but is not going to work long term.
&gt; 
&gt; &quot;@xsi:type&quot; and &quot;@type&quot; did not work

You need to bind the prefix xsi to the right URI in the namespace
context before evaluating the expression. Google for xpath and
namespaces. Then you can use @xsi:type.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323617.html</link>
</item><item>
<title>what is the correct for xpath selector for xsi:type - 12/9/2011 1:10:00 AM</title>
<description><![CDATA[<pre>Hi

I am trying use libxml2 to parse the following xml. 

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;zoo:cageRequest
    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    xmlns:zoo=&quot;http://www.example.org/Zoo&quot;
    xsi:schemaLocation=&quot;http://www.example.org/Zoo ../XSD/ZooRequest.xsd &quot;&gt;
  &lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
      &lt;name&gt;tuna&lt;/name&gt;
      &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
  &lt;/animal&gt;
&lt;/zoo:cageRequest&gt;

I need to do some special processing based on the value of xsi:type.  I eventual get a a xmlNodePtr that points to   

&lt;animal xsi:type=&quot;zoo:Fish&quot;&gt;
      &lt;name&gt;tuna&lt;/name&gt;
      &lt;numberOfFins&gt;4&lt;/numberOfFins&gt;
  &lt;/animal&gt;

I can not seem to select the attribute. &quot;@*&quot; works but is not going to work long term.

&quot;@xsi:type&quot; and &quot;@type&quot; did not work

thanks

Andy</pre>]]></description>
<link>http://www.altova.com/list/xmlschema-dev/201112/msg1000323616.html</link>
</item>

</channel>
</rss>

