Martin Hans wrote:
>
> Adding the namespaces everywhere got me a long way, but I still have
> problems in expressions that require patters, such as:
>
> <match context="$selected" pattern="li" />
>
> XXE does not accept
>
> <match context="$selected" pattern="{http://www.w3.org/1999/xhtml}li" />
Here's the explanation:
--> The "parameter" attribute of a command is a *plain* *string*. That
is namespace prefixes are treated as plain strings and have no special
meaning.
That's why you need to write:
<command name="convert"
parameter="[implicitElement] {http://www.w3.org/1999/xhtml}strong" />
--> Unlike "command", "match", "get", set elements are fully namespace
aware (their attributes are generally *XPath* *expressions*) and you
really need to use namespace prefixes.
That's why you need to write:
<match context="$selected" pattern="html:li"
xmlns:html="http://www.w3.org/1999/xhtml" />
Note that xmlns:html="http://www.w3.org/1999/xhtml" may have been added
to the root element of the configuration.
> nor does the following seem to be valid:
>
> <match context="$selected"
> pattern="li[namespace::http://www.w3.org/1999/xhtml]" />
>
Namespace nodes and namespace axis are absolutely not supported.