XPATH question
Questions about XML that are not covered by the other forums should go here.
			- 
				doncristiano
- Posts: 1
- Joined: Fri Feb 05, 2010 11:41 am
XPATH question
Post by doncristiano »
Hello
I have one question regarding an XPATH expression . Code:
and schema:
When I'm executing this XPath: 
I get the following error 
I do not know where is the mistake. Can you help me please?
Thanks.
Regards
Donoiu Cristian, ro
			
			
									
									
						I have one question regarding an XPATH expression . Code:
Code: Select all
<?xml version="1.1" encoding="UTF-8"?>
<foo:root xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:foo="http://foo"  foo:schemaLocation="http://foo file:/c:/c1.xsd"/>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo = "http://foo" elementFormDefault="qualified">
    <xs:element name="root"/>   
    <xs:simpleType name="range">
        <xs:restriction base="xs:integer">
            <xs:minInclusive value="17"/>
            <xs:maxInclusive value="18"/>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>Code: Select all
17 instance of foo:rangeCode: Select all
net.sf.saxon.trans.StaticError: XPath syntax error at char 17 (...). There is no imported schema for namespace http://fooThanks.
Regards
Donoiu Cristian, ro
- 
				adrian
- Posts: 2893
- Joined: Tue May 17, 2005 4:01 pm
Re: XPATH question
Hi,
I believe you can't use a simple type name after 'instance of' only an atomic type or a kind test:
http://www.w3.org/TR/xpath20/#id-instance-of
By the way is your XML instance another schema in itself? If not, you might have a mistake here.
I see you have another XML schema namespace declaration in the XML file:
Usually an XML instance has the XML instance namespace declaration and the schema location, like this:
Regards,
Adrian
			
			
									
									I believe you can't use a simple type name after 'instance of' only an atomic type or a kind test:
http://www.w3.org/TR/xpath20/#id-instance-of
By the way is your XML instance another schema in itself? If not, you might have a mistake here.
I see you have another XML schema namespace declaration in the XML file:
Code: Select all
xmlns:xs="http://www.w3.org/2001/XMLSchema"Code: Select all
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://foo file:/c:/c1.xsd"Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
						<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Return to “General XML Questions”
			
				Jump to
				
			
		
			
			
	
	- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service