Mariusz Idzikowski wrote:
> 
> Thank you for your suggestion to use templates to insert language attributes 
> but I would prefer to keep language information separate from the document. 
>
> Otherwise I will end up with thousands of attributes with predictable values 
> in my document, which will needlessly make it a lot bigger.

This is hard to understand for us, who are not professional lexicographers.


> 
> Now, on a more general level, are default and fixed attributes included in 
> the internal representation of XML documents in XXE? They seem to be 
> included in document validation, but I don't think I can access them from 
> macros and stylesheets, can I?
> 
> In Saxon 9.1 (but only when the -dtd:on command line parameter is set), you 
> can access default/fixed values of attributes using XPath, e.g.:
> 
> DTD (fragment)
> ===
> <!ELEMENT Headword (#PCDATA)>
> <!ATTLIST Headword lang "fr">
> 
> Document (fragment)
> =======
> ...
> <Headword>chien</Headword>
> ...
> 
> XSLT (fragment)
> ====
> <xsl:template match="Headword">
>         <xsl:copy-of select="@lang"/>
> <xsl:template>
> 
> produces:
> 
> fr
> 
> as expected.
> 
> By comparison, given the same data, the following command in XXE:
> 
> <get context="$implicitElement" expression="@lang"/>
> 
> returns nothing. It does, though,  when the value of the attribute is set 
> explicitly.
> 
> In my opinion, being able to access default/fixed attribute values from 
> XPath and CSS could prove useful in some scenarios. 


In the case of CSS, this is supported because DITA specialization
depends on it. See
http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/use-default-attribute-values.html

However, when this options is used, opening a document making use of
such CSS is much slower than otherwise.




> It would certainly do so 
> for me. Since this feature seems quite generic (after all this is why 
> default/fixed attributes were invented in the first place), could you 
> perhaps consider adding it in a future version of the editor? I understand 
> that this would depend mostly on the Saxon implementation currently used in 
> XXE, 

The XPath 1.0 implementation of XXE is native. Saxon is very loosely
coupled to XXE. We currently do not intend to change our native XPath
1.0 implementation for something else.



> but if the change doesn't involve a lot of coding and does not cause 
> major performance penalties, I would appreciate it.
> 

I'm sorry but we'll not implement this feature because it involves
substantial changes and it causes performance penalties (especially with
RELAX NG grammars). Thus, implementing this feature would force us to
make it an option, which means even more coding.


Reply via email to