I am trying to write a two-way XHTML
to FlowDocument
(FD) XSLT transformation, and I'm running into a recurring issue - there are things you can do in HTML that don't make sense (at least in this early version) in a FD. For example, XHTML has the notion of an accesskey
attribute, but there is no corresponding FD XAML element.
Even though the FD has no use for it, I need a way to store this information in the XAML of the FD so I can retrieve it later. Something along the lines of:
<xsl:template match=@accesskey>
<InvisibleElement name="accesskey" value="." />
</xsl:template>
...but to my knowledge, there is no FD element that doesn't have a corresponding display. I suppose I could use an empty <Span />
or <Run />
, but that could lead to issues if someone edits the document and inadvertently adds content where I don't expect it.
Another option might be:
<xsl:template match="@accesskey">
<InlineUIContainer Tag="accesskey">
<TextBlock Visibility="Collapsed" Tag="{.}" />
</InlineUIContainer>
</xsl:template>
Since it wouldn't be visible, it'd be uneditable.
Suggestions?