default namespace issue while transforming xfdl to xforms

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

default namespace issue while transforming xfdl to xforms

Jency Chackummoottil

 

Hi,

I have a .xfdl file(eXtensible Forms Description Language), which is an XML file, which supports the XForms standard. (ie, certain controls are written in xforms.) I’m running a stylesheet against it to convert the xfdl to xforms+ xhtml. Attached please find a sample xfdl file.

 

Here’s a part of the xpl that I use to transform the xforms: model part of xfdl to xforms.

 

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"

        xmlns:oxf="http://www.orbeon.com/oxf/processors"

        xmlns:custom="http://www.ibm.com/xmlns/prod/XFDL/Custom"

        xmlns:designer="http://www.ibm.com/xmlns/prod/workplace/forms/designer/2.6"

        xmlns:ev="http://www.w3.org/2001/xml-events"

    xmlns:xsd="http://www.w3.org/2001/XMLSchema"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.0"

     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

     xmlns:xhtml="http://www.w3.org/1999/xhtml"

      xmlns:xs="http://www.w3.org/2001/XMLSchema"

        xmlns:xforms="http://www.w3.org/2002/xforms"

        xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"

        xmlns:saxon="http://saxon.sf.net/">

 

<p:param name="instance" type="input"/>

    <p:param name="data" type="output"/>

 

<p:processor name="oxf:xslt">

     <p:input name="data" href="aggregate('root',#source,#result,#request)"/>

      <p:input name="config">

<xsl:stylesheet version="2.0" xmlns:me="com.stabilix.felix.eforms.eformUtils" exclude-result-prefixes="xhtml oxf p xfdl">

<xsl:template match="xforms:model">

                                <xsl:copy>

                                     <xsl:for-each select="@*">

                                           <xsl:copy-of select="." copy-namespaces="no"/>

                                      </xsl:for-each>

                                  

                                    <xsl:apply-templates/>

                                </xsl:copy>

                            </xsl:template>

            </xsl:stylesheet>

                </p:input>

                <p:output name="data" ref="data"/>

            </p:processor>

 

     </p:config>

 

The output that is generated contains default namespace along with xforms:model tag. Here’s a part of the output.

<xforms:model xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.0" xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0">

 

Is there any way to avoid the default namespace(xmlns=http://www.ibm.com/xmlns/prod/XFDL/7.0) from the xforms:model tag.  

 

Thanks in advance

Jency

 

 



--
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

Alshamel-Alteration-Form.xfdl (145K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: default namespace issue while transforming xfdl to xforms

Alessandro Vernet
Administrator
Jency,

On 7/16/07, Jency Chackummoottil <[hidden email]> wrote:
> Is there any way to avoid the default
> namespace(xmlns=http://www.ibm.com/xmlns/prod/XFDL/7.0)
> from the xforms:model tag.

You are saying that when you run the XPL quoted in your email on an
XFDL file, like the one you attached, the xforms:model element on the
output has an xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0". Is this
correct?

I see that in Alshamel-Alteration-Form.xfdl, <xforms:model> has this
default namespace declared. But you have a copy-namespaces="no" on the
xsl:copy. So in theory, if you don't have any element without a
prefix, the default namespace declaration shouldn't be copied. Maybe a
way around this is to just put <xforms:model> instead of <xsl:copy>.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.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
Reply | Threaded
Open this post in threaded view
|

RE: default namespace issue while transforming xfdl to xforms

Jency Chackummoottil
Yes Alex, when I run the xpl against the attached xfdl, it generates a
default namespace xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0" on
xforms:model. The output that is generated for model is <xforms:model
xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.0"
xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0">

Thanks
Jency

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Tuesday, July 17, 2007 10:20 AM
To: [hidden email]
Subject: Re: [ops-users] default namespace issue while transforming xfdl
to xforms

Jency,

On 7/16/07, Jency Chackummoottil
<[hidden email]> wrote:
> Is there any way to avoid the default
> namespace(xmlns=http://www.ibm.com/xmlns/prod/XFDL/7.0)
> from the xforms:model tag.

You are saying that when you run the XPL quoted in your email on an XFDL
file, like the one you attached, the xforms:model element on the output
has an xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0". Is this correct?

I see that in Alshamel-Alteration-Form.xfdl, <xforms:model> has this
default namespace declared. But you have a copy-namespaces="no" on the
xsl:copy. So in theory, if you don't have any element without a prefix,
the default namespace declaration shouldn't be copied. Maybe a way
around this is to just put <xforms:model> instead of <xsl:copy>.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.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
Reply | Threaded
Open this post in threaded view
|

Re: default namespace issue while transforming xfdl to xforms

Alessandro Vernet
Administrator
Jency,

On 7/16/07, Jency Chackummoottil <[hidden email]> wrote:
> Yes Alex, when I run the xpl against the attached xfdl, it generates a
> default namespace xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0" on
> xforms:model. The output that is generated for model is <xforms:model
> xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.0"
> xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0">

Have you tried changing the <xsl:copy> into <xforms:model> in the stylesheet?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.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
Reply | Threaded
Open this post in threaded view
|

RE: default namespace issue while transforming xfdl to xforms

Jency Chackummoottil
Yes, it worked. But then the namespace get attached to other nodes
inside the model.

Thanks
Jency

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Tuesday, July 17, 2007 11:57 AM
To: [hidden email]
Subject: Re: [ops-users] default namespace issue while transforming xfdl
to xforms

Jency,

On 7/16/07, Jency Chackummoottil
<[hidden email]> wrote:
> Yes Alex, when I run the xpl against the attached xfdl, it generates a

> default namespace xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0" on
> xforms:model. The output that is generated for model is <xforms:model
> xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/7.0"
> xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0">

Have you tried changing the <xsl:copy> into <xforms:model> in the
stylesheet?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.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
Reply | Threaded
Open this post in threaded view
|

Re: default namespace issue while transforming xfdl to xforms

Alessandro Vernet
Administrator
On 7/17/07, Jency Chackummoottil <[hidden email]> wrote:
> Yes, it worked. But then the namespace get attached to other nodes
> inside the model.

BTW, is it a problem if the xforms:model in the output of the
stylesheet has this xmlns="http://www.ibm.com/xmlns/prod/XFDL/7.0"? It
shouldn't be, and what Saxon (the XSLT engine) is doing here looks
correct to me: if that namespace is declared on an element from the
source, and you copy that element, it should be copied on the
destination as well (even if not used).

If everything in there has a prefix, or if elements without a prefix
are "protected" by a xmlns="" or xmlns="some other namespace", then
you should be fine.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.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