XPath Highlighting

Are you missing a feature? Request its implementation here.
solarian
Posts: 48
Joined: Thu Mar 12, 2009 10:27 pm

XPath Highlighting

Post 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.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XPath Highlighting

Post by george »

Hi,

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

Best Regards,
George
George Cristian Bina
solarian
Posts: 48
Joined: Thu Mar 12, 2009 10:27 pm

Re: XPath Highlighting

Post by solarian »

Excellent! This will be a great advantage.
solarian
Posts: 48
Joined: Thu Mar 12, 2009 10:27 pm

Re: XPath Highlighting

Post 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.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XPath Highlighting

Post 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
George Cristian Bina
solarian
Posts: 48
Joined: Thu Mar 12, 2009 10:27 pm

Re: XPath Highlighting

Post 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.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: XPath Highlighting

Post 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
George Cristian Bina
solarian
Posts: 48
Joined: Thu Mar 12, 2009 10:27 pm

Re: XPath Highlighting

Post by solarian »

Thanks -- much appreciated.
Radu
Posts: 9451
Joined: Fri Jul 09, 2004 5:18 pm

Re: XPath Highlighting

Post by Radu »

Hi,

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

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply