question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeTest, SchemaAttributeTest, ElementTest, SchemaElementTest ignores TypeName and Schema Declarations

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
DannyLamkicommented, Feb 1, 2021

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!

0reactions
DrRataplancommented, Mar 24, 2022

This has been inactive for over a year, closing this as part of my big spring-cleaning

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found