-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #510: Make XPointer work #511
base: main
Are you sure you want to change the base?
Conversation
Jing fails as it depends on Xerces. As Xerces does not support the xpointer() scheme, we need to give jing a "complete" document. The document is created by `xmllint`. Currently it's an ugly implementation as it appends ".resolved" to the `PROFILED_MAIN` variable. Probably we need to adapt the code in other locations too. For the time being, it's just the validate subcommand.
@tomschr What is the point of adding an option here instead of just making this default behavior? Getting validation failures unless you run with an extra option sounds rather inconvenient. |
It is. Actually I consider it a hack. The whole problem are our tools that we use:
Whichever component you use, you will run into problems. 😢 IMHO, the "default behavior" should be the validation with jing. I guess, not all projects need or want XPointers, so they can stick with the Jing validation. The "extended validation" is mainly needed for SLE. Unfortunately, if we really want to support XPointer (and we already use it) I don't see a better solution yet (except the "option" to fix the tools, but you know how this will end...). Unfortunately, we have some implementation issues:
So how to solve this? That's why I've suggested this additional option (we could also named it |
Is there any real downside to just applying the XPointer fix in all cases? (Besides the extra second that it may take.) I am absolutely not in favor of making life harder for everyone by adding extra parameters. I would be much in favor of using the same validation everywhere. |
Well, depends what you mean with real. Seeing not the filenames is a real problem for some, do you agree? It makes debugging harder.
Sure, that would be my aim as well. Unfortunately, the tools are the bottleneck. I think it boils down to this simple question: do we want to support XPointers? If no, we can close this issue. If yes, we need to find a solution. At the moment we have these options:
@fsundermeyer Could we have number 3, please? |
That is a big downside. I missed that part, sorry. Otoh--don't we have xml:base for that? Is there any way we could expose that information via jing?
A definite "yes" from me. |
Yes, we have Unfortunately, I fear, we have not many options:
As number 3 is probably unlikely or takes too much time, we are left with 1 + 2. If we do not want to accept the drawback on 1, that's gives us only option 2. If we theoretically implement a
I know, this sound terribly complicated and probably it is. 😢 It's likely there are many issues with this approach. Unfortunately, I can't think of a better way. Do any of you have a better idea? |
It rather boils down to the question "at what price do we want to support xpointers"? And I am definitely not willing to pay the price of crippling validation to being almost unusable. Does the xmllint run you proposed change the general formatting? |
Jing somehow returns the line number where the error occurs. We would need to find the corresponding xml:id plus the corresponding xml:base. Can that be done via xslt? |
Our validation already spits out useless line numbers and file paths that don't lead to the real source file in many cases, e.g.:
In this sense, we're just gradually getting worse (which is not a good thing either of course).
Hitches:
|
This PR fixes #510.
Jing fails as it depends on Xerces. As Xerces does not support the
xpointer()
scheme, we need to give jing a "complete" document. The document is created byxmllint
.Currently it's an ugly implementation as it appends ".resolved" to the
PROFILED_MAIN
variable. Probably we need to adapt the code in other locations too.For the time being, it's just fixes the
validate
subcommand.Addition: what's about the following suggestion?
daps validate
would use the current validation. Nothing changed.
daps validate --xpointer
would enable the different resolution path with XPointers (resolve them with
xmllint
and validate withjing
).