Evan Lenz wrote:
> Jonathan Robie wrote:
>> <$tagname>
>> <description> $d </description> ,
>> <price> $p </price>
>> </$tagname>
>>
>>This is an element constructor, not an XML literal. It does
>>not need to be valid XML, even though it looks kind of like
>>an XML element.
>>
>>However, I think it might be easier for people if we *do*
>>make our element constructors virtually identical to normal
>>XML. There would have to be a way to include dynamic parts of
>>a query, which probably requires a syntax not 100% compatible
>>with XML.
>
> Well, it might not require that. Maybe you could do something like this?
>
> <xq:element name="{$tagname}">
> <description><xq:copy-of select="$d"/></description>
> <price><xq:copy-of select="$p"/></price>
> </xq:element>
Yes, that makes sense, or perhaps:
<xq:element name="{$tagname}">
<description> {$d} </description>
<price> {$p} </price>
</xq:element>
Or perhaps:
<{$tagname}>
<description> {$d} </description>
<price> {$p} </price>
</{$tagname}>
If the escape character marks anything that is not interpreted the same way as literal XML, then the last solution seems to make sense. Are there other possiblities worth looking at?
At any rate, I think that using native XML syntax for all literal XML does make sense.
Jonathan