question about error highlighting
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Wed Apr 11, 2012 2:24 am
question about error highlighting
Post by designbymichael »
I've got a question about Oxygen's capability to offer realtime error highlighting/underlining. I see that when I'm using an undeclared namespace in my XSLT, it will automatically underline it and give me the Saxon error number and message.
But say I've got some XSLT that has: <xsl:for-each select="//Component:miniFeature">
But should read: <xsl:for-each select="//Component:miniFeatures"> (with a trailing "s")
Does Oxygen have the ability to offer realtime error feedback on when I'm trying to call a node that doesn't exist (besides rendering blank results)? Or perhaps offer node name value selection if it doesn't map out?
I see that when creating XSLT, it offers a lot of values to fill in for things like select="" statements, but nothing by way of making sure that I'm properly matching up the name values in my XML to my XSLT. Is there even an option for that?
But say I've got some XSLT that has: <xsl:for-each select="//Component:miniFeature">
But should read: <xsl:for-each select="//Component:miniFeatures"> (with a trailing "s")
Does Oxygen have the ability to offer realtime error feedback on when I'm trying to call a node that doesn't exist (besides rendering blank results)? Or perhaps offer node name value selection if it doesn't map out?
I see that when creating XSLT, it offers a lot of values to fill in for things like select="" statements, but nothing by way of making sure that I'm properly matching up the name values in my XML to my XSLT. Is there even an option for that?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: question about error highlighting
Hello,
Oxygen offers the errors/warnings that the XSLT engine provides(Saxon in this case). There is no additional checking of the XPath nodes from match/select statements with regard to the XML source.
Note that using a node that doesn't exist in an XPath is not actually an XSLT error, not even at run-time. The point is you could write a stylesheet for multiple XML sources and some might not have the node that you are using in an XPath so they simply will yield an empty sequence. Since the XSLT was written with multiple sources in mind, this lack of node would be a known fact, so it would not be something that you would want to be raised as a warning or error.
Additionally, this is very difficult to check since some, if not most, XPath expressions from select statements depend on the context or even a variable from that execution context.
Oxygen offers a few helpers when editing XSLT, if you create (or associate) an XSLT transformation scenario(Document > Transformation > Configure Transformation Scenario, New) and pick a name and an input XML file.
As a result of this association, you will have content completion in the XPath attribute values (select/match) with the nodes from the input XML file and you will also have an XML model of that input file in the "XSLT/XQuery input" view(Window > Show View > XSLT/XQuery input).
Regards,
Adrian
Oxygen offers the errors/warnings that the XSLT engine provides(Saxon in this case). There is no additional checking of the XPath nodes from match/select statements with regard to the XML source.
Note that using a node that doesn't exist in an XPath is not actually an XSLT error, not even at run-time. The point is you could write a stylesheet for multiple XML sources and some might not have the node that you are using in an XPath so they simply will yield an empty sequence. Since the XSLT was written with multiple sources in mind, this lack of node would be a known fact, so it would not be something that you would want to be raised as a warning or error.
Additionally, this is very difficult to check since some, if not most, XPath expressions from select statements depend on the context or even a variable from that execution context.
Oxygen offers a few helpers when editing XSLT, if you create (or associate) an XSLT transformation scenario(Document > Transformation > Configure Transformation Scenario, New) and pick a name and an input XML file.
As a result of this association, you will have content completion in the XPath attribute values (select/match) with the nodes from the input XML file and you will also have an XML model of that input file in the "XSLT/XQuery input" view(Window > Show View > XSLT/XQuery input).
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
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