AttributeTest, SchemaAttributeTest, ElementTest, SchemaElementTest ignores TypeName and Schema Declarations
See original GitHub issueHi there, could any of you help me?
Windows 10; Nodejs v14.8.0; Server running with express myfile.xml is a xml instance conformance with mySchema.xsd where “price” attribute is declared as xs:double type
I have run the following code:
import fs from 'fs';
import { sync } from 'slimdom-sax-parser';
import { evaluateXPath } from 'fontoxpath';
const myfile = fs.readFileSync('myfile.xml', 'utf8');
const mydoc = sync(myfile);
const r = evaluateXPath('.//attribute(price, xs:string)', mydoc);
The expected result here, is an empty secuence, whenever price was declared as a xs:double type, however all “price” attributes are returned. Similar for ElementTest. SchemaAttributeTest and SchemaElementTest returns exceptions.
- Is fontoxpath intended to be schema-aware (nowadays or in the future)?
- Is there some way of passing PSVI before or while xpath expression is evaluated?
Thanks in advance!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
XML Path Language (XPath) 2.0 (Second Edition) - W3C
4.6 Schema Attribute Test. A SchemaAttributeTest matches an attribute node against a corresponding attribute declaration found in the in-scope ...
Read more >XML Path Language (XPath) 2.0 - MOXBOX - HazMat
XPath の型付け機構は[XML Schema] に基づいている。 ... ElementTest、SchemaElementTest、AttributeTest、SchemaAttributeTest の ItemType は下記 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Martin
Thanks for your prompt reply. Now that you’ve confirmed to me the schema-aware feature isn’t implemented yet, but you are considering supporting it, in fact, yeah I’d like to help to achieve that goal. I’m aware that, as you said, schema-support isn’t a trivial feature, but I’m interested in a full (or nearly full) XPath JS implementation. Let me follow the steps indicated in your Contribution guide to getting involved. First I’d like to understand, at a high level, how you are implementing each part of the proccessing model. Let me know if I can get in touch through your email (martinmiddel@gmail.com) or another means.
Regards!
This has been inactive for over a year, closing this as part of my big spring-cleaning