Validation passes but should not v8.2
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 11
- Joined: Tue Jan 30, 2007 10:28 pm
Validation passes but should not v8.2
Validation errors are not being caught when a custom validation scenario is used.
I've created a file called junk.xsl that contains the xsl listed below. I configure a custom validation scenario pointing to master.xsl as the main file.
My master.xsl file does not include or import the junk.xsl file, nor does any other file master.xsl does include. Oxygen reports 'no problems found' in the following xsl (from junk.xsl). If I remove the custom validation scenario, the validation displays the expected errors around the stylesheet mismatch, the unclosed node tag and the undeclared variable.
[code]<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="label">
<xsl:value-of select="$I-Know-This-Variable-Has-Not-Been-Declared-As-Of-July11-2007"
Just some random junk
</xsl:template>
</xsl:transform>[/code]
I've created a file called junk.xsl that contains the xsl listed below. I configure a custom validation scenario pointing to master.xsl as the main file.
My master.xsl file does not include or import the junk.xsl file, nor does any other file master.xsl does include. Oxygen reports 'no problems found' in the following xsl (from junk.xsl). If I remove the custom validation scenario, the validation displays the expected errors around the stylesheet mismatch, the unclosed node tag and the undeclared variable.
[code]<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="label">
<xsl:value-of select="$I-Know-This-Variable-Has-Not-Been-Declared-As-Of-July11-2007"
Just some random junk
</xsl:template>
</xsl:transform>[/code]
Thanks!
Angela Williams
Angela Williams
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
If the file specified in the validation scenario, in your case master.xsl does not include or import the current file, in your case junk.xsl then the validation operation cannot report any validation error in the current file. The validation checks the file specified in the validation scenario so it reports errors in that file and any files imported or included by that file. Defining a validation scenario does not make sense in your case. A scenario is useful when the current XSLT stylesheet uses a template or a variable declared in other stylesheet and it must be validated in the context of that stylesheet in order to have all the declarations available just as it happens when the current file is used in the XSLT transformation.
Regards,
Sorin
If the file specified in the validation scenario, in your case master.xsl does not include or import the current file, in your case junk.xsl then the validation operation cannot report any validation error in the current file. The validation checks the file specified in the validation scenario so it reports errors in that file and any files imported or included by that file. Defining a validation scenario does not make sense in your case. A scenario is useful when the current XSLT stylesheet uses a template or a variable declared in other stylesheet and it must be validated in the context of that stylesheet in order to have all the declarations available just as it happens when the current file is used in the XSLT transformation.
Regards,
Sorin
-
- Posts: 11
- Joined: Tue Jan 30, 2007 10:28 pm
Your reply does not make sense. I know when and why to use the validation scenario. I gave a clear example that should absolutely fail validation and it did not.
I found the issue because the original file WAS included in the master.xsl which fixed validation errors on variable names declared in other imported files.
In that case, that is the ONLY validation that occurred, though. None of my syntax errors in the included file failed validation. To illustrate this, I created the junk.xsl file that should clearly not pass any standard of validation and it still did.
When a file is included in a validation scenario, the only validation that occurs is to make sure variables, functions, attribute-sets, and named templates declared elsewhere do not error when used within other files. It should ALSO still perform all other standard validation AND IT DOES NOT.
Don't take my word for it. Please test this out using the previously posted xsl and any xsl as the master that includes that file.
I found the issue because the original file WAS included in the master.xsl which fixed validation errors on variable names declared in other imported files.
In that case, that is the ONLY validation that occurred, though. None of my syntax errors in the included file failed validation. To illustrate this, I created the junk.xsl file that should clearly not pass any standard of validation and it still did.
When a file is included in a validation scenario, the only validation that occurs is to make sure variables, functions, attribute-sets, and named templates declared elsewhere do not error when used within other files. It should ALSO still perform all other standard validation AND IT DOES NOT.
Don't take my word for it. Please test this out using the previously posted xsl and any xsl as the master that includes that file.
Thanks!
Angela Williams
Angela Williams
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Dear Angela,
When you define a validation scenario the validate action executes that scenario only and does not apply any other validation on the current file. So, if you specify an XSL file that does not include/import the current file directly or indirectly then the current file will not be validated at all because the validation scenario will validate only the master file.
I saved your file as incl.xsl and I created a master file master.xsl. I set a validation scenario for incl.xsl to validate the master.xsl file.
Now the expected behavior is as below.
1. If the master file contains
I get errors.
2. If the master file is
I get no errors when applying the validate action on incl.xsl.
That is because in both cases the validation is performed on the master.xsl file and in the first case incl.xsl is alse validated because it is included in that file while in the second case it is not validated because master.xsl dos not refer to it.
I hope the above clarifies how validation scenarios work.
If you still have issues please post a complete example to avoid any possible confusions.
Best Regards,
George
When you define a validation scenario the validate action executes that scenario only and does not apply any other validation on the current file. So, if you specify an XSL file that does not include/import the current file directly or indirectly then the current file will not be validated at all because the validation scenario will validate only the master file.
I saved your file as incl.xsl and I created a master file master.xsl. I set a validation scenario for incl.xsl to validate the master.xsl file.
Now the expected behavior is as below.
1. If the master file contains
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:include href="incl.xsl"/>
</xsl:stylesheet>
2. If the master file is
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
</xsl:stylesheet>
That is because in both cases the validation is performed on the master.xsl file and in the first case incl.xsl is alse validated because it is included in that file while in the second case it is not validated because master.xsl dos not refer to it.
I hope the above clarifies how validation scenarios work.
If you still have issues please post a complete example to avoid any possible confusions.
Best Regards,
George
George Cristian Bina
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