XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] The limits of XML mean the limits of my data world

> > Therefore, continuously running data that may have no start and/or
>   > end
>   > doesn't seem to fit this definition, as at any moment of time we
>   > don't have
>   > "the whole data", thus we are not able to say whether or not this is
>   > a
>   > well-formed document.

>   That's true, but again, there's no prohibition against acting on a
>   partial document, only on saying the document as a whole is well-formed
>   XML.

>   >
>   > I think there are mechanisms in at least some programming languages
>   > of
>   > monitoring data streams, recognizing data patterns and their
>   > repetitions,
>   > recognizing "events" in the running data and perceiving it as a
>   > stream of
>   > events.
>   >
>   > Can anyone suggest how to represent this in XML?

>   Usually you have a set of pattern/action pairs. This is for example how
>   XSLT 3 works in streaming mode: whenever a pattern is matched (a
>   template match pattern in a mode with streaming="yes") the
>   corresponding template body is used to construct a result sequence.

There is no disagreement here about what can be done using XSLT.

But the question is not about this! The question is what can be expressed with XML.

When the input is streaming and it "looks like XML" it is still not XML and it can turn out at any moment that the input is not XML.

Not only this, but when such an error is encountered, there is the problem of rolling back the whole processing that has been done up until that moment.

If we decide not to roll-back the processing, then we recognize the fact that the input wasn't really XML and that we don't care...

And the knowledge that not everything has to be expressed as XML but it still can be processed, looks perfectly acceptable (and inevitable) to me. This is the only wise and realistic decision.

Thanks,
Dimitre

On Sun, May 29, 2022 at 4:32 PM Liam R. E. Quin <liam@fromoldbooks.org> wrote:
On Sun, 2022-05-29 at 09:01 -0700, Dimitre Novatchev wrote:
> > Would you provide an example of something that cannot be expressed
> > in XML
> but can be expressed in some other data language, please?
>
> The whole notion of a "well-formed XML document" implies that this
> needs to
> be present as a whole in memory (RAM or other type).

I'd dispute that.  The XML spec allows a parser to return parse events
before the end of the document so long as it clearly signals an error
if it finds one, and does not then continue to claim the input is XML.
There are streaming parsers, e.g. using the SAX API.

> Therefore, continuously running data that may have no start and/or
> end
> doesn't seem to fit this definition, as at any moment of time we
> don't have
> "the whole data", thus we are not able to say whether or not this is
> a
> well-formed document.

That's true, but again, there's no prohibition against acting on a
partial document, only on saying the document as a whole is well-formed
XML.

>
> I think there are mechanisms in at least some programming languages
> of
> monitoring data streams, recognizing data patterns and their
> repetitions,
> recognizing "events" in the running data and perceiving it as a
> stream of
> events.
>
> Can anyone suggest how to represent this in XML?

Usually you have a set of pattern/action pairs. This is for example how
XSLT 3 works in streaming mode: whenever a pattern is matched (a
template match pattern in a mode with streaming="yes") the
corresponding template body is used to construct a result sequence.

liam

--
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org


--
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
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they write all patents, too? :)
-------------------------------------
Sanity is madness put to good use.
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.
 


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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS