XInclude and XLink: how to get working?


J

jmichae3

I have a .xml XML data structure and a .xsl XSLT stylesheet.
I made another .xml file that xincludes these two.

<?xml version="1.0" encoding="UTF-8"?>
<!--include:crossReference xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:include="http://www.w3.org/XML/1998/namespace">
<locator xlink:type="extended" xlink:href="menu7.xml" xlink:role="XML" xlink:title="web site structure"/>
<locator xlink:type="extended" xlink:href="menu7.xsl" xlink:role="XSL" xlink:title="reformat XML as HTML5"/>
</include:crossReference-->

<document xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="1.xml" parse="xml" role="structure">
<xi:fallback>ERROR: menu7.xml (structure) could not be loaded.</xi:fallback>
</xi:include>
<xi:include href="1.xsl" parse="xml" role="reformat XML as HTML5">
<xi:fallback>ERROR: menu7.xsl (style sheet) could not be loaded.</xi:fallback>
</xi:include>
</document>

but it doesn't work in opera or ff. the XSLT is supposed to render as HTML5 using
<xsl:eek:utput
method="html"
doctype-system="about:legacy-compat"
encoding="UTF-8"
indent="yes" />
for the doctype.
 
Ad

Advertisements

M

Martin Honnen

I have a .xml XML data structure and a .xsl XSLT stylesheet.
I made another .xml file that xincludes these two.

<?xml version="1.0" encoding="UTF-8"?>
<!--include:crossReference xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:include="http://www.w3.org/XML/1998/namespace">
<locator xlink:type="extended" xlink:href="menu7.xml" xlink:role="XML" xlink:title="web site structure"/>
<locator xlink:type="extended" xlink:href="menu7.xsl" xlink:role="XSL" xlink:title="reformat XML as HTML5"/>
</include:crossReference-->

<document xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="1.xml" parse="xml" role="structure">
<xi:fallback>ERROR: menu7.xml (structure) could not be loaded.</xi:fallback>
</xi:include>
<xi:include href="1.xsl" parse="xml" role="reformat XML as HTML5">
<xi:fallback>ERROR: menu7.xsl (style sheet) could not be loaded.</xi:fallback>
</xi:include>
</document>

but it doesn't work in opera or ff.

I am not aware of browsers supporting XInclude.
 
Ad

Advertisements

J

Joe Kesselman

I am not aware of browsers supporting XInclude.

I'd suggest you use XSLT to produce the effect of XInclude, but with
Chrome threatening to remove their XSLT support that may not be portable
either. You may have to do this on the server side.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top