You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by qMax <qm...@mediasoft.ru> on 2005/01/31 11:31:54 UTC

Re[2]: namespaces in Form Editor

Thursday, January 27, 2005, 7:38:38 PM, andreas@apache.org wrote:

AH> qMax wrote:
>> this misfeature is undocumented, as well as FormEditor itself.
>> 
>> in file /pubs/$pub/lenya/xslt/formeditor/$doctype.xsl:
>> when using, eg:
>> <node name="NodeName" select="/ns:elem[@tagID='{ns:elem/@tagID}']">
>>   <content>
>>     <textarea name="&lt;xupdate:update
>> select=&quot;/ns:node[@tagID='{ns:elem/@tagID}']&quot;&gt;">
>>       <xsl:value-of select="ns:elem"/>
>>     </textarea>
>>   </content>
>> </node>
>> 
>> namespace "ns", which is used in embedded xupdate expression,
>> should be decared and actually used as a prefix in edited document
>> (that's - in all documents if this type).
>> 
>> To be editable with FormEditor, documents can not have default namespace.

AH> IIUC this is not a mistake of the forms editor, but rather a drawback
AH> of XPath (you can't declare namespace prefix mapping in an XPath).
yes, seems so.
xpath suposes, that namespaces are declared in xml document where xpath is used,
in this case - in xupdate document.

is it correct to declare xmlns in xupdate directives ?
e.g.:
<xupdate:insert-after xmlns:p="myuri" select="/p:node/p:subnode">...

AH> But if you use the syntax
AH> xupdate:update select=&quot;/*[local-name() = '...' and namespace-uri() =
AH> '...'][@tagID='{ns:elem/@tagID}']
AH> it should work with the default namespace too.

but content of form generation stylesheet then became huge mesh.

BTW - why xupdate directives are all escaped in attributes,
rather then put as plain xml as children ?

-- 
 qMax


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: namespaces in Form Editor

Posted by Andreas Hartmann <an...@apache.org>.
qMax wrote:

[...]

> AH> IIUC this is not a mistake of the forms editor, but rather a drawback
> AH> of XPath (you can't declare namespace prefix mapping in an XPath).
> yes, seems so.
> xpath suposes, that namespaces are declared in xml document where xpath is used,
> in this case - in xupdate document.
> 
> is it correct to declare xmlns in xupdate directives ?
> e.g.:
> <xupdate:insert-after xmlns:p="myuri" select="/p:node/p:subnode">...

Actually I don't think so. But I'm not sure, you could consult
the XUpdate spec.


> AH> But if you use the syntax
> AH> xupdate:update select=&quot;/*[local-name() = '...' and namespace-uri() =
> AH> '...'][@tagID='{ns:elem/@tagID}']
> AH> it should work with the default namespace too.
> 
> but content of form generation stylesheet then became huge mesh.

Yes, that is true. Unfortunately I don't know a better solution.


> BTW - why xupdate directives are all escaped in attributes,
> rather then put as plain xml as children ?

No idea. Maybe Michi knows?

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org