cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dusek <jason.du...@gmail.com>
Subject Re: cocoon & catalogs
Date Mon, 10 Oct 2005 16:51:11 GMT
the xslt does not output a namespace declaration for my xml. here is a
fuller example:

<xsl:stylsheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:lay="space://layout">

  <xsl:template match="resume">
    <lay:layout>
      <xsl:apply-templates/>
    </lay:layout>
  </xsl:template>

  <!-- more of the same -->

</xsl:stylesheet>

the output looks like this:

<?xml encoding="ISO-SOMETHING-OR-OTHER" version="1.0"?>
<lay:layout>
  <!-- more of the same -->
</lay:layout>

notice that there is no namespace declaration. (btw, how do i change
the default encoding to utf-8?) so i thought, maybe if i add the
schemaLocation to my code, cocoon will realize that it's a real
namespace and output the namespace declaration. however, this doesn't
work:

<xsl:stylsheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:lay="space://layout">

  <xsl:template match="resume">
    <lay:layout xsi:schemaLocation="space://layout schema://layout">
      <xsl:apply-templates/>
    </lay:layout>
  </xsl:template>

  <!-- more of the same -->

</xsl:stylesheet>

when i run this transform, the transformer just dumps all the text
nodes in an invalid document.

> Besides, the catalog system is only for DTD's and
> usually not used for locating schema's.

so how am i supposed to redirect for schemas, then? is there a
'standard' way to do this, like with catalogs? does it go in
cocoon.xconf or something like that? i don't want to use catalogs or
hack up cocoon if i don't have to.
--
_jason

On 10/10/05, Geert Josten <Geert.Josten@daidalos.nl> wrote:
> Hi Jason,
>
> First of all, what do you expect to happen by referencing to a schema from an xslt? XSLT
(1.0) isn't
> meant to care for DTD's and Schema's other that adding doctypes or namespaces.
>
> Even the FileGenerator doesn't care for doctypes and schema references. If you want to
verify your
> xml, you will have to start a validating process explicitly.
>
> There was a ValidatingTransformer available in the community, I believe.
>
> Besides, the catalog system is only for DTD's and usually not used for locating schema's.
It should
> not be difficult to hook the catalog system to a URIResolver that is used for locating
the schema's,
> but you will have to dig in Java code..
>
> HTH,
> Geert
>
> Jason Dusek wrote:
>
> > i would like to have cocoon look at a document like this:
> >
> > <layout
> >   xsi:schemaLocation="space://layout schema://layout"
> >   xmlns="space://layout">
> >  <data/>
> > </layout>
> >
> > and finds its schema based on this catalog entry:
> >
> > SYSTEM "schema://layout where/is/it/layout.xsd"
> >
> > what i've done so far is write my own catalog, and reference it in the
> > cocoon catalog in context://WEB-INF/entities/
> >
> > -- jsn's stuff --
> > CATALOG "/home/jsn/public_html/resources/catalogs/catalog"
> >
> > but this doesn't work at all - when i try to reference the schema in
> > xslt, it just dumps all the text-nodes. where can i go for help on
> > this? i've been searching the net for 1.5+ days and basically get a lot
> > of specs.
> > --
> > _jason
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
> --
> Drs. G.P.H. Josten
> Consultant
>
>
>
> Daidalos BV
> Source of Innovation
> Hoekeindsehof 1-4
> 2665  JZ  Bleiswijk
> Tel: +31 (0) 10 850 1200
> Fax: +31 (0) 10 850 1199
> www.daidalos.nl
>
>
> De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en
is
> uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen,
verzoeken
> wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


--
_jason

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message