[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Feasibility of "do all application coding in the XML langu

  • From: "Dimitre Novatchev" <dnovatchev@g...>
  • To: "Rushforth, Peter" <Peter.Rushforth@n...>
  • Date: Wed, 3 Dec 2008 09:42:24 -0800

Re:  Feasibility of "do all application coding in the XML langu
On Wed, Dec 3, 2008 at 6:58 AM, Rushforth, Peter
<Peter.Rushforth@n...> wrote:
> Dimitre,
>
> I have to confess even after reading the code, I don't understand it.
>
> Can you supply an example invocation using a simple input example,
> and expected output?
>
> I am definitely interested in anything that helps broaden the
> possible inputs to XSLT!
>

Peter,

Sometimes ago I posted to the xsl-list this short description of the
arguments to f:lr-parse(). It can be found here:

   http://biglist.com/lists/xsl-list/archives/200711/msg00642.html


You can play with a small example located at:

   http://fxsl.cvs.sourceforge.net/viewvc/fxsl/fxsl-xslt2/Tests/TestFunc-lrParse.xsl?view=markup&sortby=file


In this example, the parser is invoked with this code snippet:

  11  <xsl:variable name="vsimpleExprPPTables" select=
   12   "document('../data/simpleExprParseTables.xml')/*"/>
   13
   14  <xsl:template match="/">
   15    <xsl:sequence select=
   16     "f:lrParse($vsimpleExprPPTables,
   17                     '3 + 4*5 - (7%3)',
   18                     f:lexer-simpleExpr(),
   19                     f:OnSimpleExprRuleReduced()
   20                )
   21                  /computedValue/node()
   22      "
   23     />
   24  </xsl:template>

and the result from the transformation is: 22

The parse tables, which the general LR parser needs are located at
'../data/simpleExprParseTables.xml'. They are generated with the YACCX
tool (available on the FXSL project downloads at:

   http://fxsl.cvs.sourceforge.net/viewvc/fxsl/fxsl-xslt2/Tools/YACCX/?sortby=file
                  ),
 which is just YACC, extended to generate its output as XML.

Two other, very big examples are the current parsers for JSON (as used
in the f:json-document() function and the XPath 2.0 parser)

I would be glad to assist you in producing your own parsers.



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play





> Cheers,
> Peter
>
>> -----Original Message-----
>> From: Dimitre Novatchev [mailto:dnovatchev@g...]
>> Sent: December 2, 2008 11:57 PM
>> To: Rushforth, Peter
>> Cc: xml-dev@l...; Costello, Roger L.
>> Subject: Re:  Feasibility of "do all application
>> coding in the XML languages"?
>>
>> On Tue, Dec 2, 2008 at 7:23 AM, Rushforth, Peter
>> <Peter.Rushforth@n...> wrote:
>>
>> > I think there's  a lot of value in such interfaces.  It
>> would be nice
>> > if it didn't involve having to write a parser each time,
>> but the cost
>> > is not too high, I think
>>
>> The cost is not high, especially if one uses a general and
>> portable native XSLT 2.0 parser writing tool, such as the
>> LR(1) Parsing Framework of FXSL,
>>
>>
>> http://fxsl.cvs.sourceforge.net/viewvc/fxsl/fxsl-xslt2/f/func-
>> lrParse.xsl?revision=1.7&view=markup&sortby=date
>>
>>
>>
>> --
>> Cheers,
>> Dimitre Novatchev
>> ---------------------------------------
>> Truly great madness cannot be achieved without significant
>> intelligence.
>> ---------------------------------------
>> To invent, you need a good imagination and a pile of junk
>> -------------------------------------
>> Never fight an inanimate object
>> -------------------------------------
>> You've achieved success in your field when you don't know
>> whether what you're doing is work or play
>>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.