Page 1 of 1

XPath Highlighting

Posted: Mon Dec 14, 2009 5:12 am
by solarian
When performing an XPath query in the toolbar (e.g., "//p"), it would be nice if, when clicking on the result in the results window, only the relevant element were highlighted instead of the entire line.

e.g., if you have the following all on the same line:

Code: Select all

<div><h1>Title</h1><p>text1</p><p>text2</p></div>
then it will highlight them all. This can be problematic if one has many elements all in the same line of text.

Re: XPath Highlighting

Posted: Mon Dec 14, 2009 12:27 pm
by george
Hi,

This functionality will be available in version 11.1 later this week.

Best Regards,
George

Re: XPath Highlighting

Posted: Mon Dec 14, 2009 12:59 pm
by solarian
Excellent! This will be a great advantage.

Re: XPath Highlighting

Posted: Tue Dec 15, 2009 2:56 am
by solarian
By the way, if it's also possible to get the same functionality when clicking on error messages, that would be similarly useful.

Re: XPath Highlighting

Posted: Tue Dec 15, 2009 3:16 pm
by george
We try to locate the error as exactly as possible and we have special code to do that in many situations. There may be cases however that are not covered by our current implementation. Please provide a sample and we will see what can be done.

Best Regards,
George

Re: XPath Highlighting

Posted: Tue Dec 15, 2009 10:32 pm
by solarian
I've realised that this is, as far as I know, specific to the Jing parser.

If one creates a TEI Bare file from the template, then adds a <note/> element with an invalid attribute:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_bare.rng" type="xml"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Title</title>
</titleStmt>
<publicationStmt>
<p>Publication Information</p>
</publicationStmt><sourceDesc>
<p>Information about the source</p>
</sourceDesc></fileDesc>
</teiHeader>
<text>
<body>
<p>Some text here<note test="123">abc</note></p>
</body>
</text>
</TEI>
then if one clicks on the error (or just looks at the red underline without clicking) it highlights the entire line up to the <note> start tag, plus one character following. This behaviour seems consistent regardless of the error.

Note that if we have an empty tag (rather than a start-tag/end-tag pair) causing an error (e.g. "<ptr/>"), the one character following is no longer inside that element.

Re: XPath Highlighting

Posted: Tue Dec 15, 2009 10:58 pm
by george
Thanks!
I will log an enhancement request to try to locate better the errors reported by Jing.
The processing I referred to in my previous message applies for XML Schema and DTD related errors.

Best Regards,
George

Re: XPath Highlighting

Posted: Tue Dec 15, 2009 11:53 pm
by solarian
Thanks -- much appreciated.

Re: XPath Highlighting

Posted: Tue Aug 31, 2010 4:36 pm
by Radu
Hi,

Oxygen 12 (which will appear in a couple of weeks) will report more precisely such errors.

Regards,
Radu