Hi
It seems that the namespace bindings in scope at an 'xdb:query' element (in the 'query' input of an 'oxf:xmldb-query' processor) are added to the result of the query. Is it intended? Regards, --drkm ___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
On 8/8/06, Florent Georges <[hidden email]> wrote:
> It seems that the namespace bindings in scope at an 'xdb:query' > element (in the 'query' input of an 'oxf:xmldb-query' processor) are > added to the result of the query. No such thing here... Anyone to confirm ? -- Damiano ALBANI -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Damiano Albani wrote:
> On 8/8/06, Florent Georges wrote: > > It seems that the namespace bindings in scope at an 'xdb:query' > > element (in the 'query' input of an 'oxf:xmldb-query' processor) > > are added to the result of the query. > No such thing here... Anyone to confirm ? No, it is my fault, sorry. I though the bindings came from the query, but the elements were inserted from an XPL script, with the document directly embedded: <p:processor name="oxf:xmldb-insert"> <p:input name="datasource"> <datasource> ... </datasource> </p:input> <p:input name="query"> <xdb:insert collection="..."/> </p:input> <p:input name="data"> <root> ... </root> </p:input> </p:processor> So it is normal the namespace bindings for XDB, OXF and P were inserted in eXist. I did post too early, without testing enough. Mea culpa. Regards, --drkm ___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Florent Georges wrote:
> No, it is my fault, sorry. I though the bindings came > from the query, but the elements were inserted from an XPL > script, with the document directly embedded The only simple solution I found is to use an XSLT script just to can use @xsl:exclude-result-prefixes: <p:processor name="oxf:xslt"> <p:input name="data" href="model.xpl"/> <p:input name="config"> <root xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:exclude-result-prefixes="p oxf xdb" xsl:version="2.0"> ... </root> </p:input> <p:output name="data" id="doc"/> </p:processor> Of course, I can also use an external document. But all this is just to test, and I don't know if it can be usefull in a real case. But while doing this, I found no way to not set the data input to the XSLT processor. Because I don't use the context item, I don't need to set it. A common practice is to use instead the name of a template as the entry point. Is there a way to set this name? Or at least to just not set the context item? Regards, --drkm ___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
On 8/8/06, Florent Georges <[hidden email]> wrote:
> But while doing this, I found no way to not set the data > input to the XSLT processor. Because I don't use the > context item, I don't need to set it. A common practice is > to use instead the name of a template as the entry point. > Is there a way to set this name? Or at least to just not > set the context item? Florent, If you are not using the 'data' input you can write something like: <p:input name="data"><dummy/></p:input> This has 2 benefits: 1) The XSLT engine creates a structure internally for the input document. So in this case we minimize the size of this structure. 2) It makes it a little clearer in the code that this <dummy/> element is not of much use. If you put an 'href' one reading your code might wonder what you are doing with this document in your XSLT code. Alex -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alessandro Vernet wrote:
> If you are not using the 'data' input you can write something like: > <p:input name="data"><dummy/></p:input> Yes, it is certainly the better solution. Especially your second point: the intention is clear. But I'm still surprised it is not possible to set instead the name of a template as entry point (as the XSLT REC defines both input tree and template name as valid input for a processor). Thanks for the idea. Regards, --drkm ___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
On 8/9/06, Florent Georges <[hidden email]> wrote:
> But I'm still surprised it is not possible to set instead the name of > a template as entry point (as the XSLT REC defines both input tree and > template name as valid input for a processor). Florent, A template name? Would you point me to the part where the recommendation talks about this? Alex -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alessandro Vernet wrote:
> A template name? Would you point me to the part where the > recommendation talks about this? In §2.3, Initiating a Transformation: http://www.w3.org/TR/xslt20/#initiating You can have an initial context node (the input 'data' in OPS), the name of a template, and an initial mode. All optional: [Definition: The transformation is performed by evaluating an initial template. If a named template is supplied when the transformation is initiated, then this is the initial template; otherwise, the initial template is the template rule selected according to the rules of the xsl:apply-templates instruction for processing the initial context node in the initial mode.] About the initial context node: If no initial context node is supplied, then the context item, context position, and context size will initially be undefined, and the evaluation of any expression that references these values will result in a dynamic error. It is a common practice to have an XSLT script that don't use the input tree (using no tree at all or retrieving them by doc() instead), and to invoque it with the name of the initial template. For example with Saxon: > saxon -it main script.xsl with this template in script.xsl: <xsl:template name="main"> ... IMHO, something like this could be fine in XPL: <p:processor name="oxf:xslt"> <!-- The initial context node. --> <p:input name="data" .../> <!-- 'it' or 'template' or 'initial-template', the name of the initial named template. --> <p:input name="it" .../> <!-- The initial mode. --> <p:input name="mode" .../> ... With *all* optional. Hope that helps. Regards, --drkm ___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Florent,
On 8/10/06, Florent Georges <[hidden email]> wrote: > You can have an initial context node (the input 'data' in > OPS), the name of a template, and an initial mode. All > optional: > > [Definition: The transformation is performed by > evaluating an initial template. If a named template is > supplied when the transformation is initiated, then this > is the initial template; otherwise, the initial template > is the template rule selected according to the rules of > the xsl:apply-templates instruction for processing the > initial context node in the initial mode.] > > About the initial context node: > > If no initial context node is supplied, then the context > item, context position, and context size will initially > be undefined, and the evaluation of any expression that > references these values will result in a dynamic error. > It is a common practice to have an XSLT script that don't > use the input tree (using no tree at all or retrieving them > by doc() instead), and to invoque it with the name of the > initial template. For example with Saxon: > > > saxon -it main script.xsl The Saxon documentation says: -it template -- Selects the initial named template to be executed. If this is namespaced, it can be written as {uri}localname. When this option is used, the source file should be omitted. Does this mean you cannot have a source document when using the -it option? I would think that if you don't have an source document, then you need to specify the initial template. But if you do specify an initial template, then you are still allowed to have a source document. Alex -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alessandro Vernet wrote:
Hi > > [Definition: The transformation is performed by > > evaluating an initial template. If a named template > > is supplied when the transformation is initiated, > > then this is the initial template; otherwise, the > > initial template is the template rule selected > > according to the rules of the xsl:apply-templates > > instruction for processing the initial context node > > in the initial mode.] > This good to know. Every day is an opportunity to learn > something new :). Ayup. And the last few days the new things I learned were almost about OPS ;-). Amazing! I love the idea of XML pipeline, but never had the opportunity to use one before. > > > saxon -it main script.xsl > The Saxon documentation says: > -it template -- Selects the initial named template to be > executed. If this is namespaced, it can be written as > {uri}localname. When this option is used, the source file > should be omitted. > Does this mean you cannot have a source document when > using the -it option? I would think that if you don't have > an source document, then you need to specify the initial > template. But if you do specify an initial template, then > you are still allowed to have a source document. I think so. Neither the definition above nor the whole section forbid this, I think. I'll post an email to the Saxon ML (but Mike is on vacation as for now). Regards, --drkm p4.vert.ukl.yahoo.com uncompressed/chunked Thu Aug 10 21:13:39 GMT 2006 ___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Florent Georges wrote:
> I think so. Neither the definition above nor the whole > section forbid this, I think. I'll post an email to the > Saxon ML (but Mike is on vacation as for now). It is posted: http://sf.net/mailarchive/forum.php?thread_id=30128313&forum_id=1398 Colin Adams, the implementor of the Gestalt XSLT 2.0 processor in Eiffel, confirmed having both inputs is legal. I guess we have to wait Mike to know the final word about the Saxon's command-line syntax (as Colin pointed out, it is possible to set both inputs from Java). Regards, --drkm p4.vert.ukl.yahoo.com uncompressed/chunked Fri Aug 11 09:13:38 GMT 2006 ___________________________________________________________________________ Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. http://fr.answers.yahoo.com -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |