On 6.12.2004 10:06 Uhr, Michael Wechner wrote: > Gregor J. Rothfuss wrote: > >> michi, do you recall if we still need >> >> <?xml version="1.0" encoding="UTF-8"?><html xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:unizh="http://unizh.ch/doctypes/elements/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://www.w3.org/1999/xhtml" dc:dummy="FIXME:keepNamespace" dcterms:dummy="FIXME:keepNamespace" lenya:dummy="FIXME:keepNamespace" unizh:columns="2"> >> >> the dummy namespace declarations? > > yes, the "multiple" forms editor gets a problem otherwise (see FIXME) > > src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java > > because IIRC org.apache.xpath.compiler.XPathParser will have a problem. > > Some time ago I had an idea how to fix this, but didn't get around to try it out. In libxml2 (the XML/XSLT/XPath library I use), the XPath engine is only aware of prefix-to-namespaceURI mappings defined in the root node (or the context note, for that matter). In JS it's basically the same, and it looks like in your engine, also. According to the spec, this doesn't have to happen, but usually engines do that for easier use. Therefore, looks like you need your own PrefixResolver for making XPath correctly work ( found this http://www.stylusstudio.com/api/xalan-j_2_6_0/org/apache/xml/utils/PrefixResolver.htm ). We had to do this in BXE as well. And in PHP there's a method $xpathquery->registerNamespace($prefix,$uri) for the same problem. The same goes for default namespaces (another fixme in that file). There are no default namespaces in XPath ;) You have to use some prefixes for them (and of course register, resp. do an PrefixResolver) HTH chregu >> iirc they are in there because one of the form editors would strip them out otherwise.
A bit more information. If a document has the following namespaces and dummy attributes defined: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" xhtml:dummy="FIXME:keepNamespace" dc:dummy="FIXME:keepNamespace" lenya:dummy="FIXME:keepNamespace" > The forms editor writes this out in the work area: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" dc:dummy="FIXME:keepNamespace" lenya:dummy="FIXME:keepNamespace" tagID="tag.1" :dummy="FIXME:keepNamespace" > The problem seems to be with the default namespace being stripped by the forms editor. Michi points out that XSLT is being used during saving: src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java So switching the XSLT processor library might cause a problem.
i believe this has been addressed with the port of the multiple forms editor to uc fw