Finding the code from schematorn message
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Finding the code from schematorn message
Hi,
when the schematron validation fails it writes a message. When clicking on the message the cursor goes to the node that has been evaluated. Is there an easy way to jump to the schematron rule that generated this message?
Since my schema is quite complex with few schematron files and several xsd files with embeded schematron rules finding it manuelly already takes quite some time...
As a workaround I already considered marking each rule with a unique id so I can at least find it with "find in files". Do I have to add this into the text content of the assert/report element or is there any attribute that is passed to the output as well?
Thanks and regards,
Patrik
when the schematron validation fails it writes a message. When clicking on the message the cursor goes to the node that has been evaluated. Is there an easy way to jump to the schematron rule that generated this message?
Since my schema is quite complex with few schematron files and several xsd files with embeded schematron rules finding it manuelly already takes quite some time...
As a workaround I already considered marking each rule with a unique id so I can at least find it with "find in files". Do I have to add this into the text content of the assert/report element or is there any attribute that is passed to the output as well?
Thanks and regards,
Patrik
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Finding the code from schematorn message
Hello,
You've already identified a good workaround in using an error id to identify the location from the schema.
Regards,
Adrian
I'm afraid there isn't. When you validate the XML instance with a Schematron schema the errors highlighted in the instance are not paired with the rule from the Schematron schema.Patrik wrote:when the schematron validation fails it writes a message. When clicking on the message the cursor goes to the node that has been evaluated. Is there an easy way to jump to the schematron rule that generated this message?
You've already identified a good workaround in using an error id to identify the location from the schema.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Re: Finding the code from schematorn message
After diving a little deeper into schematron I found out that it's actually quite easy to add the location information to the messages. I simply added the following code to the template "process-message":
show-code-pos is a new parameter I had to set to "true" as default.
However, this is usually only interesting when you really have a problem with a schematron rule. Otherwiese the additional text is probably more annoying. Thus, an additional configuration parameter within oxygen would be nice to set the parameter show-code-pos accordingly.
Maybe you could consider adding this to oxygen.
Thanks and regards,
Patrik
Code: Select all
<xsl:if test="$show-code-pos = 'true'">
<axsl:text>
<xsl:text> [filename: </xsl:text>
<xsl:value-of select="replace(@oxy:elementURI, '.*/', '')"/>
<xsl:text>, line: </xsl:text>
<xsl:value-of select="@oxy:elementLine"/>
<xsl:text>, column: </xsl:text>
<xsl:value-of select="@oxy:elementLine"/>
<xsl:text>, uri: </xsl:text>
<xsl:value-of select="@oxy:elementURI"/>
<xsl:text>]</xsl:text>
</axsl:text>
</xsl:if>
However, this is usually only interesting when you really have a problem with a schematron rule. Otherwiese the additional text is probably more annoying. Thus, an additional configuration parameter within oxygen would be nice to set the parameter show-code-pos accordingly.
Maybe you could consider adding this to oxygen.
Thanks and regards,
Patrik
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Finding the code from schematorn message
Post by radu_pisoi »
Adding the possibility to identify the assert or report element that generates a certain Schematron message is a nice feature that will help Schematron developers to easily edit their schemas.
As you already noted, this feature can be annoying in some circumstances. So, there should be an option for enabling this support.
I will record an issue on our side.
As you already noted, this feature can be annoying in some circumstances. So, there should be an option for enabling this support.
I will record an issue on our side.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service