No template exists named:
Oxygen general issues.
No template exists named:
Hi,
I have been trying to include header.xsl file in body.xsl file.
I tried both include and import. When I specifically calls the header template it is giving me out this error.
The code is here:
body.xsl
I tried include/import and call-template/apply-templates. Though apply-templates does not give this error, but no output too.
Your help is much appreciated.
I have been trying to include header.xsl file in body.xsl file.
I tried both include and import. When I specifically calls the header template it is giving me out this error.
The code is here:
body.xsl
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:n2="http://irb.mit.edu/irbnamespace">
<xsl:import href="path is here/Reports/Header.xsl" />
....
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="header" /> or
<xsl:apply-templates select="header">
....
Your help is much appreciated.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: No template exists named:
Post by sorin_ristache »
Hello,
Regards,
Sorin
Open the stylesheet in the XSL editor of oXygen (the default editor for XSL files), place the cursor on the value of the attribute href, in your example path is here/Reports/Header.xsl, right click and select the action Open -> Open File at Caret from the popup menu. Does it open the file Header.xsl in oXygen? If it opens the file then the file exists at that location and it is imported correctly? If it does not open the file then the file does not exist at that location.sweetuv wrote:Code: Select all
<xsl:import href="path is here/Reports/Header.xsl" />
Regards,
Sorin
Re: No template exists named:
Thank you, Sorin. The file did open in Oxygen. I am sure that the file exists in the location (I could open it in the browser also). Before this trial, I kept the header.xsl file in some other place and everything worked well. After I placed it in, one of the actual environments it is giving me this trouble.
Could not find template named: header
Do you think it might have to do something with the environment?
Thanks,
Could not find template named: header
Do you think it might have to do something with the environment?
Thanks,
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: No template exists named:
Post by sorin_ristache »
Hello,
In that case the problem is the missing header template. It should be defined in the main XSL file or one of the included or imported XSL files, that is your stylesheet must contain something like:
This is needed by the following call used in your stylesheet:
Regards,
Sorin
In that case the problem is the missing header template. It should be defined in the main XSL file or one of the included or imported XSL files, that is your stylesheet must contain something like:
Code: Select all
<xsl:template name="header">
...
</xsl:template>
Code: Select all
<xsl:call-template name="header" />
Sorin
Re: No template exists named:
Thanks again.
the Header.xsl file has this:
And I have imported/included this header file in body.xsl and called the template:
This worked perfectly fine till I had to change the location of the Header.xsl file now. (I could read the Header.xsl file from the new location as you mentioned in the previous comments)
Thanks
the Header.xsl file has this:
Code: Select all
<xsl:template name="header">
....
</xsl:template>
Code: Select all
<xsl:include href="http://www.indiana.edu/~byourwts/xslt/Header.xsl" />
.....
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="header" />
...
</fo:flow>
Thanks
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: No template exists named:
Post by sorin_ristache »
Can you send sample files for reproducing the error on our test computers? We will try to apply your sample XSL stylesheet to your sample XML document for getting the same error and telling you how to fix the error.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: No template exists named:
Post by sorin_ristache »
Hello,
Thank you for the files. As I specified in a previous post the call
can be executed only if your stylesheet defines a template like
Your stylesheet includes only the following template which will not be called by the above xsl:call-template:
I do not know what you try to process in your stylesheet but it is an XSLT template use problem. I recommend you to read an XSLT tutorial about creating and matching template rules in XSLT. You can find good XSLT tutorials here and here.
Regards,
Sorin
Thank you for the files. As I specified in a previous post the call
Code: Select all
<xsl:call-template name="header" />
Code: Select all
<xsl:template name="header">
...
</xsl:template>
Code: Select all
<xsl:template match="header">
<fo:block>
...
</fo:block>
</xsl:template>
Regards,
Sorin
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