You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "michael-hoke (via GitHub)" <gi...@apache.org> on 2023/09/12 22:51:46 UTC
[GitHub] [daffodil-vscode] michael-hoke opened a new issue, #850: Augment XPath Validation to be More Complete
michael-hoke opened a new issue, #850:
URL: https://github.com/apache/daffodil-vscode/issues/850
When viewing the PCAP schema using the extension, several items are highlighted as errors that we should look to resolve.
$dfdl:byteOrder
$pcap:valueLen
fn:concat with 2 arguments
It looks like $dfdl:byteOrder is an external variable - we need to figure out how to identify external variables
It looks like $pcap:valueLen is created with a dfdl:newVariableInstance tag - we need to parse that to get the variables
We are already able to get variables and insert them into the XPath tokenizer - it's just a matter of figuring out how to augment our current detection with these types of variables.
@mbeckerle are there other cases/examples of XPath values in a schema (e.g outputValueCalc/inputValueCalc) that we are missing?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Augment XPath Validation to be More Complete [daffodil-vscode]
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate closed issue #850: Augment XPath Validation to be More Complete
URL: https://github.com/apache/daffodil-vscode/issues/850
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] mbeckerle commented on issue #850: Augment XPath Validation to be More Complete
Posted by "mbeckerle (via GitHub)" <gi...@apache.org>.
mbeckerle commented on issue #850:
URL: https://github.com/apache/daffodil-vscode/issues/850#issuecomment-1717572536
The "xpath" expressions are not exactly XPath, but DFDL's variant thereof, (which we sometimes unoffically call DPath).
They can reference variables defined by the DFDL schemas themselves as in the $prefix:variableName notation you've seen. These are defined via the dfdl:defineVariable construct. Those declarations most commonly come from include/imports of the schema. Like you can't just search backward in the text and hope to find them. It requires a "whole schema" model to know if they are properly spelled or not.
Short term I think the best you can do is recognize $, which introduces a variable, and parse the prefix and be sure there is a namespace binding for the prefix, and leave it at that.
Longer term, you want Daffodil to give you an error message that the variable name is unknown in order to know if it should be marked as an error or not. This requires compiling the schema. (Or at least part of compiling it. And we should be discussing what services Daffodil needs to provide to the IDE so that it can do this sort of semantic highlighting of compilation errors, such as expressions that are not properly typed.)
There are 4 built in DFDL variables. They use $dfdl:byteOrder style notation. They're defined in section 7.7.1.2 of the spec.
Whether a variable is external or not wouldn't affect the IDE display or not. External variables can just be bound by config files or the API before running a parse/unparse where non-external variables are for private use within the schema only, but either way users can misspell their names, etc.
These are the 4 built-in predefined variables:
dfdl:encoding
dfdl:byteOrder
dfdl:binaryFloatRep
dfdl:outputNewLine
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org