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

Re: SGML complexity

  • From: <juanrgonzaleza@c...>
  • To: <xml-dev@l...>
  • Date: Fri, 8 Sep 2006 07:47:59 -0700 (PDT)

latex brackets
David Carlisle said:
>
>>  The problem with XSLT (at least 1.0 that i studied) is that is not
>> powerful enough for that kind of task.
>
> Actually XSLT1 is capable of transforming (a big enough subset of) latex
> to mathml, the hard part of course being matching brackets. i've
> implemented that before (without using any extension functions, so it
> would run in mozilla, mainly), but it's clearly not an optimal language
> for doing that (xslt2 would be a lot better but even that isn't really
> optimal for parsing non regular languages where, by definition, regular
> expressions are not enough)

1) "Big enough" is filed dependent

2) Since XSLT is Turing complete, it is obvious that can do (in theory)
the task. Still XSLT 2 add extra functionality to XSLT 1. Do you see that
I mean by "is not powerful enough"?

>> I am transforming trees in both cases of above; i am transforming a
>> XML doc in another XML doc
>
> XSLT is designed for transforming node trees to node trees:

Technically i am transforming node trees

<math code="LaTeX">x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}</math>

to node trees

<math>
  <mi>x</mi>
  <mo>=</mo>
  <mfrac>
    <mrow>
      <mrow>
        <mo>-</mo>
        <mi>b</mi>
      </mrow>
      <mo>&PlusMinus;</mo>
      <msqrt>
        <msup>
          <mi>b</mi>
          <mn>2</mn>
        </msup>
        <mo>-</mo>
        <mrow>
          <mn>4</mn>
          <mo>&InvisibleTimes;</mo>
          <mi>a</mi>
          <mo>&InvisibleTimes;</mo>
          <mi>c</mi>
        </mrow>
      </msqrt>
    </mrow>
    <mrow>
      <mn>2</mn>
      <mo>&InvisibleTimes;</mo>
      <mi>a</mi>
    </mrow>
  </mfrac>
</math>

> it
> (especially in its 1.0 release) is explictly not designed for parsing
> content that happens to be stored in an XML element or attribute.

Technically, XSLT include capabilities for parsing content into elements
thanks to XPath string capabilities. XSLT was designed to being able to do
transformations like

<author>Carlisle, David</author>

to

<author><surname>Carlisle</surname><name>David</name></author>

The problem with example i did is that is too complex for XSLT.

> You
> can't (or at least shouldn't) argue that a language designed to
> transform XML trees is somehow deficient if it can't (easily) parse
> latex or English or Fortran or any other content that the XML document
> might have as character data.

After receiving some 'feedback' at this list, I simply pointed that XSLT
cannot be conceived as a language optimal for any XML transformation. The
XSLT spec clearly emphasizes the role of XSLT, several XSLT authors
recognize both off and on-line.

> David


Juan R.

Center for CANONICAL |SCIENCE)




[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-2013 All Rights Reserved.