Lists Home |
Date Index |
> > The quickest code for doing this is to write a loop through
> > the string,
> I see from this and your post on xsl-list that you're a man who likes
> low-level coding.
No, Michael, it is not so. I am just trying to match the level of coding
to the level of the problem. And, regarding the xsl-list post, I am not
asking for lower-level coding; in fact, I think that coding with
perl|python|ruby would be higher-level and more natural than with
> What's wrong with:
don't get me wrong, I am not trying to compete. But:
1) it only works with Java 1.4+. I simply don't have it installed on
any of my computers because they are slow and it takes twice as much
time to launch as 1.3.
2) it only returns the first character. The OP asked to convert a bunch
to a string.
3) it does not handle literal character in the input. The code below does.
If you add all these things to the single line above, you'll get as much
code, only slower and running on fewer platforms.
> Also untested.
> OK, add a couple more lines to do hex as well (but the OP didn't ask for
The code that just retrieves the first decimal character entity from a string
without regexps is as short as the line above. I've just tried to provide
a solution that would work.
Besides, I was just reacting the idea to use DOMDoc for that purpose.