[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: default namespaces in Schematron

  • From: George Cristian Bina <george@oxygenxml.com>
  • To: trubliphone@googlemail.com
  • Date: Thu, 21 Oct 2010 21:06:53 +0300

Re:  default namespaces in Schematron
It does not matter how the namespace is specified in the XML instance. 
Just declare the namespace with an ns element in Schematron and use that 
prefix to refer to elements from that namespace.

Best Regards,
George
-- 
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/21/10 8:52 PM, trubliphone wrote:
> Hello.
>
> Does anybody know how to specify default namespaces in Schematron?
>
> Given the following sort of XML:
>
> <root>
> <foo/>
> </root>
>
> And the following sort of SCH:
>
> <schema xmlns="http://purl.oclc.org/dsdl/schematron">
> <pattern>
> <rule context="foo">
> <assert test="bar">foo must have bar</assert>
> </rule>
> </pattern>
> </schema>
>
> A Schematron validator correctly asserts that <foo> is missing a child
> <bar>.
>
> However, as soon as I assign a namespace to the XML:
>
> <root xmlns="http://my.server.com">
>
> the Schematron rule fails to match.  Presumably, this is because the
> element <foo> is now in the "http://my.server.com" namespace.
>
> Schematron allows a <ns> element to solve just this problem.  But it
> requires a uri and a prefix.  The above, being a default namespace, has
> no prefix.
>
> Any ideas?
>
> Thanks


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.