Error using transform method (XSLT Module)

Friday, 11 May 2012 · 5 messages · last reply 14 May 2012
AC
Anand Chiney11 May 2012 13:14 #
Hi there, I am using BaseX 7.2 Beta. I am trying to extract certain XML Documents from the DB and then applying the XSLT to convert these docs to HTML. Following is the query, which I am typing in Editor -
let $in := /Chapters
let $style := doc('C:\Program Files\BaseX\data\chapter.xslt')
return <Chapters>{(
  xslt:transform($in, $style),
  xslt:transform($in, $style)
)}</Chapters>
I am getting error message - *Error: [FODC0002] "" (Line 34): </head> found, </meta> expected.* First I thought that, <META> tag might be compulsory. So I added the same to the XSLT file. Still error.... What does it means? Am I doing anything wrong? The XSLT works correctly when used individually with Java code. Ready to sent the XML and XSLT File....
-- Regards Have a nice day :) Anand C
IL
Imsieke, Gerrit, le-tex11 May 2012 13:38 #
err:FODC0002, Error retrieving resource. http://www.w3.org/TR/xpath-functions-30/#ERRFODC0002 Since the chapters are already in the database (as XML nodes), it must be the stylesheet. Is you XSL stylesheet well-formed XML? Did you use an empty <meta …/> element there, or did you just type the opening <meta …> tag? But then it won’t run with any standalone processor, either. Gerrit
Quoted text · Anand Chiney · 43 lines
On 2012-05-11 13:14, Anand Chiney wrote: > Hi there, > > I am using BaseX 7.2 Beta. > > I am trying to extract certain XML Documents from the DB and then > applying the XSLT > to convert these docs to HTML. > > Following is the query, which I am typing in Editor - > > let $in := /Chapters > let $style := doc('C:\Program Files\BaseX\data\chapter.xslt') > return <Chapters>{( > xslt:transform($in, $style), > xslt:transform($in, $style) > )}</Chapters> > > > I am getting error message - > *Error: [FODC0002] "" (Line 34): </head> found, </meta> expected.* > > First I thought that, <META> tag might be compulsory. So I added the same > to the XSLT file. Still error.... > > What does it means? Am I doing anything wrong? > > The XSLT works correctly when used individually with Java code. > > Ready to sent the XML and XSLT File.... > > -- > Regards > > Have a nice day :) > Anand C > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Gerrit Imsieke Geschäftsführer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke at le-tex.de, http://www.le-tex.de Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930 Geschäftsführer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard Vöckler
AC
Anand Chineyin reply to Anand Chiney, 11 May 2012, 13:1414 May 2012 08:34 #
Dear Team, http://docs.basex.org/wiki/XSLT_Module Out of the 3 Example, 1 and 3 are working... at my end. The error with the second one is as - *Error: [FODC0002] Could not compile stylesheet* Have a nice day Regs Anand C
Quoted text · Anand Chiney · 38 lines
On Fri, May 11, 2012 at 4:44 PM, Anand Chiney <anandc.air at gmail.com> wrote: > Hi there, > > I am using BaseX 7.2 Beta. > > I am trying to extract certain XML Documents from the DB and then applying > the XSLT > to convert these docs to HTML. > > Following is the query, which I am typing in Editor - > > let $in := /Chapters > let $style := doc('C:\Program Files\BaseX\data\chapter.xslt') > return <Chapters>{( > xslt:transform($in, $style), > xslt:transform($in, $style) > )}</Chapters> > > > I am getting error message - > *Error: [FODC0002] "" (Line 34): </head> found, </meta> expected.* > > First I thought that, <META> tag might be compulsory. So I added the same > to the XSLT file. Still error.... > > What does it means? Am I doing anything wrong? > > The XSLT works correctly when used individually with Java code. > > Ready to sent the XML and XSLT File.... > > -- > Regards > > Have a nice day :) > Anand C > >
-- Regards Have a nice day :) Anand Chiney
MG
Maximilian Gärber14 May 2012 09:30 #
Hi, I've never seen a stylesheet without the <stylesheet> root element and at least one <template> inside. Should be something like: <xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<html xmlns='http://www.w3.org/1999/xhtml'>
    <body>
      <h1>Books</h1>
      <ul>
        <xsl:for-each select='books/book'>
...
Regards, Max 2012/5/14 Anand Chiney <anandc.air at gmail.com>
Quoted text · Anand Chiney · 73 lines
> > Dear Team, > > http://docs.basex.org/wiki/XSLT_Module > > Out of the 3 Example, 1 and 3 are working... at my end. > > > The error with the second one is as - > > Error: [FODC0002] Could not compile stylesheet > > > Have a nice day > > Regs > Anand C > > > > On Fri, May 11, 2012 at 4:44 PM, Anand Chiney <anandc.air at gmail.com> wrote: >> >> Hi there, >> >> I am using BaseX 7.2 Beta. >> >> I am trying to extract certain XML Documents from the DB and then applying the XSLT >> to convert these docs to HTML. >> >> Following is the query, which I am typing in Editor - >> >> let $in := /Chapters >> let $style := doc('C:\Program Files\BaseX\data\chapter.xslt') >> return <Chapters>{( >> xslt:transform($in, $style), >> xslt:transform($in, $style) >> )}</Chapters> >> >> >> I am getting error message - >> Error: [FODC0002] "" (Line 34): </head> found, </meta> expected. >> >> First I thought that, <META> tag might be compulsory. So I added the same >> to the XSLT file. Still error.... >> >> What does it means? Am I doing anything wrong? >> >> The XSLT works correctly when used individually with Java code. >> >> Ready to sent the XML and XSLT File.... >> >> -- >> Regards >> >> Have a nice day :) >> Anand C >> > > > > -- > Regards > > > Have a nice day :) > Anand Chiney > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
CG
Christian Grün14 May 2012 19:11 #
Dear Anand, thanks all, I have updated the buggy example (it was successfully parsed by Saxon, which is probably the reason why it managed to slip into the documentation): http://docs.basex.org/wiki/XSLT_Module#Examples Christian
Quoted text · Maximilian Gärber · 99 lines
On Mon, May 14, 2012 at 9:30 AM, Maximilian Gärber <mgaerber at arcor.de> wrote: > Hi, > > I've never seen a stylesheet without the <stylesheet> root element and > at least one <template> inside. Should be something like: > > <xsl:stylesheet version='2.0' > xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> > > <xsl:template match="/"> > <html xmlns='http://www.w3.org/1999/xhtml'> > <body> > <h1>Books</h1> > <ul> > <xsl:for-each select='books/book'> > ... > > Regards, > > Max > > 2012/5/14 Anand Chiney <anandc.air at gmail.com> >> >> Dear Team, >> >> http://docs.basex.org/wiki/XSLT_Module >> >> Out of the 3 Example, 1 and 3 are working... at my end. >> >> >> The error with the second one is as - >> >> Error: [FODC0002] Could not compile stylesheet >> >> >> Have a nice day >> >> Regs >> Anand C >> >> >> >> On Fri, May 11, 2012 at 4:44 PM, Anand Chiney <anandc.air at gmail.com> wrote: >>> >>> Hi there, >>> >>> I am using BaseX 7.2 Beta. >>> >>> I am trying to extract certain XML Documents from the DB and then applying the XSLT >>> to convert these docs to HTML. >>> >>> Following is the query, which I am typing in Editor - >>> >>> let $in := /Chapters >>> let $style := doc('C:\Program Files\BaseX\data\chapter.xslt') >>> return <Chapters>{( >>> xslt:transform($in, $style), >>> xslt:transform($in, $style) >>> )}</Chapters> >>> >>> >>> I am getting error message - >>> Error: [FODC0002] "" (Line 34): </head> found, </meta> expected. >>> >>> First I thought that, <META> tag might be compulsory. So I added the same >>> to the XSLT file. Still error.... >>> >>> What does it means? Am I doing anything wrong? >>> >>> The XSLT works correctly when used individually with Java code. >>> >>> Ready to sent the XML and XSLT File.... >>> >>> -- >>> Regards >>> >>> Have a nice day :) >>> Anand C >>> >> >> >> >> -- >> Regards >> >> >> Have a nice day :) >> Anand Chiney >> >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

⚡Generated with XQuery