Re: [xml] namespace-alias result-prefix



Hi,

This issue is related to
http://bugzilla.gnome.org/show_bug.cgi?id=341325
and a bit of
http://bugzilla.gnome.org/show_bug.cgi?id=313711

I changed the processor to generate the "result-prefix" prefix
in the refactored code paths (define XSLT_REFACTORED); but since
I cannot foresee when we'll be able to enable this code,
a patch for the current behaviour would be good, I think.
The current code performs aliasing during transformation, every
time it hits a literal result element; the refactored code
computes the result prefix/namespace at compilation time.

Note that Xalan and the old Saxon behaves the same way
as Libxml2 currently does for XSLT 1.0. Only in the XSLT 2.0
spec, the resulting prefix needs to be the "result-prefix";
but the prefix still might be changed if there's a namespace
clash (a rather unlikely scenario).

(by the way: direct Libxslt related issues to xslt gnome org)

Greetings from the unemployed front ;-)

Kasimier

-------- Original-Nachricht --------
Datum: Tue, 12 Sep 2006 17:07:50 +0200

Age Jan Kuperus wrote:
Hello,

As far as I can see, the current namespace-alias implementation does
exactly what is necessary 
according to the standard. Unfortunately, the standard defines what
should happen with the 
namespace itself, but does not specify which prefix should be used in
the result.

The current libxslt (well, I'm using libxslt 1.1.15, but it probably has
not changed since; at 
least there is nothing about it in the changelog) just copies the prefix
used in the stylesheet.

As a result, a stylesheet that starts with

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:new="http://www.w3.org/1999/XSL/TransformAlias";>
     <xsl:namespace-alias stylesheet-prefix="new" result-prefix="xsl"/>
     <xsl:output method="xml" version="1.0" encoding="utf-8"
indent="yes"/>

will generate a stylesheet that starts with

<?xml version="1.0" encoding="utf-8"?>
<new:stylesheet xmlns:new="http://www.w3.org/1999/XSL/Transform";>
     <new:output ...

which is syntactically correct, but could confuse a less experienced
stylesheet writer.

As we all like to standardise ;-) I would suggest to use the value of
result-prefix in the 
output instead. 

{removed a line that on second thought didn't make sense]


Please let me know whether a patch that makes this change would make it
into the library, in 
which case I'll try to create one.




-- 
with kind regards,

Age Jan Kuperus
Bibliotheek Wageningen UR

[...]



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