Section numbering using xmerl:export
Mikael Karlsson
mikael.karlsson@REDACTED
Thu Aug 29 22:27:36 CEST 2002
Hmm,
This sounds interesting,
would this also mean that one could perform XSL-type operations like
having an arbitrary order of rearranging/filtering the transformed
elements, like making a contents table, etc. As it is now it seems that
you have to maintain the input XML document order in the export.
/Mikael
torsdag 29 augusti 2002 18:07 skrev Ulf Wiger:
..
> One idea would be to modify the export concept to do something
> similar to xmerl_xpath. I had thought about doing this to make
> XSL-type operations possible via the export API. The trick used
> by xmerl_xpath is to put the full parent element in the parents
> list instead of just the {Tag, Position} indicator.
>
> This might seem expensive from a memory consumption point of
> view, but it is in fact just a pointer to the element behind the
> scenes. This would allow the tag function to freely inspect its
> parent or its siblings. In your case, you could go via the parent
> element and look at the preceding siblings, counting the
> occurences of 'section' elements.
>
> If this appeals to the rest of you, I could prototype such a
> modification. I don't know how much of an issue backwards
> compatibility is for xmerl...?
>
> /Uffe
More information about the erlang-questions
mailing list