xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] xsl:include statement is "unexpected element".


Subject: Re: [xsl] xsl:include statement is "unexpected element".
From: Tim Hibbs <xsl.posting@xxxxxxxxx>
Date: Fri, 12 Mar 2010 08:26:29 -0700

Wendell,

Thanks for the tip. I got a similar tip after I incorrectly posted an
XSL question to the XSL-FO list. A fellow there, Mario Madunic, was
kind enough to offer this information and gently coax me to post in
the right forum. I've since followed your and his advice, and it's
working reasonably well for me.

Appreciate the assistance,

Tim

On Thu, Mar 11, 2010 at 4:48 PM, Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
wrote:
> Hi,
>
> At 01:37 PM 3/11/2010, was written:
>>
>> Tim Hibbs wrote:
>>
>>> Ah HA!
>>> I have it several levels down, which is undoubtedly the problem:
>>> <xsl:stylesheet>...
>>> B  <xsl:template>...
>>> B  B  B <xsl:if>...
>>> B  B  B  B  <xsl:include>...
>>> It must be a child, and not a descendant, apparently. Thank you.
>>> Is there a way to package and include templates at a level lower than
>>> child-of-stylesheet-or-transform?
>>
>> No, the file you include must itself be a stylesheet (i.e. have an
>> xsl:stylesheet or xsl:transform root element).
>> This is what the XSLT 1.0 specification says about xsl:include:
>>
>> B "The inclusion works at the XML tree level. The resource located by the
>> href attribute value is parsed as an XML document, and the children of the
>> xsl:stylesheet element in this document replace the xsl:include element in
>> the including document. The fact that template rules or definitions are
>> included does not affect the way they are processed."
>
> You could, however, encapsulate the logic you want in a named template, and
> call that where you've placed your xsl:include.
>
> You can then put that template in the included module. Not hard, really.
>
> This is not a conditional include. It is just a conditional call to
> something that happens to be included (which is usually just as good).
>
> Cheers,
> Wendell
>
>
>
>
> ======================================================================
> Wendell Piez B  B  B  B  B  B  B  B  B  B  B  B  B 
B mailto:wapiez@xxxxxxxxxxxxxxxx
> Mulberry Technologies, Inc. B  B  B  B  B  B  B 
B http://www.mulberrytech.com
> 17 West Jefferson Street B  B  B  B  B  B  B  B  B  B Direct Phone:
301/315-9635
> Suite 207 B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B 
B Phone: 301/315-9631
> Rockville, MD B 20850 B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  B  Fax:
301/315-8285
> ----------------------------------------------------------------------
> B Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================


Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor