After a while of hacking java solutions, that could be done
using xslt I'll
try making a second attempt in using xsl. I have some
fundamental problems
getting started:
I want to transform an xhtml file input and transform it into
something
else, but I get an error with a non defined entity.
The document may contain mathml, danish letters æøå and other
odd things.
These things should just go straight through the
transformation without any
transformation, but the engine keeps arguing that it must be
defined....
Can it be avoided that the transformation engine worries
about definitions
of entities?
If not: how can I easily import these definitions?
The input xhtml is strict and can be viewed in mozilla, so
there are no
problems there.
If you are talking about entity resolution then the xml parser must attempt to
resolve the entity to ensure the xml is well-formed.
You can turn off validation, but the parser will still attempt to get the dtd
for this purpose.
To get around this, you can try implementing your own entity resolver in java,
and just return the entity reference (instead of what it resolves to) or if you
are using xerces you can set the feature
http://apache.org/xml/features/nonvalidating/load-external-dtd to false which I
think will ignore the dtd altogether.
In your case, are you talking entities or character references? I'm guessing
you're using xhtml entities that are not legal in xml - if you could post a
sample that fails then it would be a little clearer.
cheers
andrew