Re: [xml] Re: libxslt question


    It's a XSLT question, not a libxslt question. Take a look at
<xsl:document> element at XSLT specs.

Thanks. I was looking at an old draft of XSLT (1999) which didn't have that element. However, I'm still not sure how to use it.

        Sure... <xsl:document> is not defined in XSLT 1.0.

Which function does the actual writing of these sub-documents? And what

        Just apply stylesheet with xsltApplyStylesheet(). Yes.. is that
easy :) Take a look at John Fleck's libxslt tutorial

happens if the stylesheet tries to place them in directories that do not exist, will those then be created? I'm asking because the document names

        Sure it will not create directories, AFAIK. It will raise an
I/O error.

and directories they are places in should in my case be derived from the input data.

        No problem. Take a look in this small example. What you have
to do is create output document path/file within href attribute of

        Lucas Brasilino

<?xml version="1.0" ?>
  <foo name="first">
    <text>Foo 1</text>
  <foo name="second">
    <text>Foo 2</text>

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="";>
  <xsl:output method="html"/>

  <xsl:template match="/">

  <xsl:template match="foo">
    <xsl:document href="{concat('out',position(),'.html')}">
      <xsl:for-each select="text">
            <title><xsl:value-of select="."/></title>
            <h1><xsl:value-of select="."/></h1>


Lucas Brasilino
brasilino recife pe gov br
Emprel -        Empresa Municipal de Informatica (pt_BR)
                Municipal Computing Enterprise (en_US)
Recife - Pernambuco - Brasil
Fone: +55-81-34167078

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]