Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Feasibility of "do all application coding in the XML

From: "Dimitre Novatchev" <dnovatchev@-----.--->
To: "Rushforth, Peter" <Peter.Rushforth@-----------.--.-->
Date: 12/3/2008 5:43:00 PM
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: [xml-dev] 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
>>
>

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent