Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to produce HTML report when testing a stylesheet that produces output with a doctype declaration. #2

Closed
GoogleCodeExporter opened this issue Jun 8, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Hello Jeni,

I am attempting to test a stylesheet that contains

<xsl:output method="xml" version="1.0" encoding="utf-8"
doctype-system="codebook2.dtd" doctype-public="-//JMP//DTD CodeBook v.8//EN"/>

I can produce an XML test result, but it contains a doctype declaration
matching the values in the xsl:output element:

<?xml-stylesheet type="text/xsl"
href="file:/C:/Documents%20and%20Settings/jsulak/My%20Documents/scripts/xspec-v0
.1/format-xspec-report.xsl"?><!DOCTYPE
s:report
  PUBLIC "-//JMP//DTD CodeBook v.8//EN" "codebook2.dtd">

When this XML test result is fed into format-xspec-report.xsl, it fails,
since Saxon can't find the DTD.  

The root of the problem (I think) is that the testing transform produced by
generate-xspec-tests.xsl imports the original transform using
<xsl:import/>.  Since the original transform does have @doctype-system and
@doctype-public explicitly defined, the testing transform uses those values
instead of the default empty values defined in the testing transform.

I'm not sure how you would get around the problem.  I experimented with
placing <xsl:result-document /> inside of the "main" template, but no luck.  

If it helps, the output from the batch file is below:

Started: "C:\Documents and Settings\jsulak\My
Documents\scripts\xspec-v0.1\xspec.bat" "A:\XML Sandbox\Legislative
Update\Pipeline\Code Cleanup\test_remove.xml"
Creating Test Stylesheet...
"c:\temp\xspec\test_remove.xsl"
"A:\XML Sandbox\Legislative Update\Pipeline\Code Cleanup\test_remove.xml"

Running Tests...
Testing with SAXON 9.1.0.1
Annotations
..A group of annotations with categories
    Categories are propagated to the annotations; elements are renamed.
    No category elements in annotation root
..A group of annotations without categories
    Empty category elements are created
    No category elements in annotation root
..When an annotationinfo element is present, the order must be correct.
    Category comes after annotationinfo.
Remove deprecated attributes
    Attribute removed

Formatting Report...
Error 
  java.io.FileNotFoundException: c:\temp\xspec\codebook2.dtd (The system
cannot find the
  file specified)
Transformation failed: Run-time errors were reported
'"c:\temp\xspec\test_remove-result.html"' is not recognized as an internal
or external command,
operable program or batch file.
Done.
Process ended with exit code: 0

I'm enjoying playing with XSpec, so keep up the good work.

Thanks,

-James

Original issue reported on code.google.com by jsulak@gmail.com on 8 Oct 2008 at 8:30

@GoogleCodeExporter
Copy link
Author

Sorry for taking so long to get round to looking at this. I just tried to 
replicate this and couldn't. The generated 
test stylesheet uses <xsl:result-document> to create the report, and uses its 
own output format, which 
shouldn't (and doesn't, as far as I can tell) inherit the doctype directives 
from the stylesheet under test.

Could you grab hold of the latest version from trunk and test whether you're 
still encountering this problem 
with it? If so, could you provide me with a sample stylesheet and XSpec which 
demonstrate the issue.

Thanks,

Jeni

Original comment by jeni.ten...@gmail.com on 9 Nov 2008 at 6:09

  • Changed state: WorksForMe

@GoogleCodeExporter
Copy link
Author

No worries.  I got the latest from the repository, and it indeed works for me 
now, too.  

Thanks,

-James

Original comment by jsulak@gmail.com on 22 Nov 2008 at 11:28

innovimax referenced this issue in innovimax/xspec Jan 17, 2017
# The first commit's message is:
#2 initial commit

# This is the 2nd commit message:

add saxon9he

# This is the 3rd commit message:

remove cat and saxon

# This is the 4th commit message:

add tests
innovimax referenced this issue in innovimax/xspec Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant