xsl-list
[Top] [All Lists]

Re: [xsl] XSLT Text Processing: Fun with Anagrams

2007-04-24 19:24:45
Hi Dimitre and everyone,

Thank you for your help and for additional instructions.

It took me a while to figure out the CVS repository since I'm using it
the first time on SourceForge -- but anyways, I got everything and
tried the 3 XSL sheets you mentioned.

I could see the output for:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java -jar c:\dev\saxonb8-9-0-3j\saxon8.jar dictEnglish.xml
testGenerateAnagramDict.xsl > output.xml

Everthing looks great in the output except for one small thing: I
noticed that words with apostrophes were also being considered.

For example:
<aChain key="'aainprsst"><w>aspirant's</w><w>partisan's</w></aChain>

I think the above should be (if I'm not wrong with my understanding of
English words):
<aChain key="'aainprsst"><w>aspirants</w><w>partisans</w></aChain>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Then I tried :

--------------------------------------------------------------
java -jar c:\dev\saxonb8-9-0-3j\saxon8.jar dictAnagrams.xml
testGetDictAnagrams.xsl > output2.xml which worked out great.

-------------------------------------------------------------

However I wasn't able to try one more style sheet successfully:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java -jar c:\dev\saxonb8-9-0-3j\saxon8.jar dummy.xml
testGetAnagrams.xsl > output.xml

I think testGetAnagrams.xsl is supposed to be a stand-alone stylesheet?

I don't think there's an option to call an XSL stylesheet without an
input XML, so I created a dummy xml file with just one node, but got a
blank output.

Please let me know if testGetAnagrams.xsl expects an input XML, if so
what it should be.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Overall, this is excellent demonstration of XSLT's capabilities.

-Thank you
Rashmi

On 4/24/07, Dimitre Novatchev <dnovatchev(_at_)gmail(_dot_)com> wrote:
Hi Rashmi,


You should get the FXSL distribution from CVS, not from the zip files,
which are almost one year old.

The files you'd be using for the anagrams solution are:

    testGetAnagrams.xsl  Gets anagrams with a specific key, without an
anagram dict.

    testGenerateAnagramDict.xsl Produces an Anagram dict from the
regular English dct

    testGetDictAnagrams.xsl Gets anagrams with a specific key, using
an anagram dict


Please, do let me know if you still  have any problems accessing the sources.



--
Cheers,
Dimitre Novatchev

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--