Greetings, folks -
In an idle moment, I pasted this snippet of example code
from the factorcode.org page, just for fun:

USING: io kernel sequences
http.client xml xml.data xml.traversal ;

"http://factorcode.org"; http-get nip string>xml
"a" deep-tags-named
[ "href" attr ] map
[ print ] each

! this breaks in string>xml w/ the error:

mismatched
line   105
column 0
open   T{ name f "" "br" "http://www.w3.org/1999/xhtml"; }
close  T{ name f "" "body" "http://www.w3.org/1999/xhtml"; }
Mismatched tags
Opening tag: <br>
Closing tag: </body>

! but closing <br> w/ </br> (as per XHTML ??):

USING: io kernel sequences
http.client xml xml.data xml.traversal
splitting ;

"http://factorcode.org"; http-get nip
"<br>" "<br> </br>" replace string>xml
"a" deep-tags-named
[ "href" attr ] map
[ print ] each

! ...succeeds

The entry for <br> in w3schools 'tags' reference
<http://www.w3schools.com/tags/tag_br.asp> reads:

"Definition and Usage

The <br> tag inserts a single line break.

The <br> tag is an empty tag which means that it has no end tag.

Differences Between HTML 4.01 and HTML5
NONE.

Differences Between HTML and XHTML

In HTML, the <br> tag has no end tag.

In XHTML, the <br> tag must be properly closed, like this: <br />."

However, inserting
    "<br>" "<br> < />" replace string>xml
or
    "<br>" "<br> </>" replace string>xml
still breaks in string>xml, but inserting
    "<br>" "<br> </br>" replace string>xml
works fine for me.

Is this just a consequence of the Factor code running on my ancient
OS X 10.6.8 system (Snow Leopard lives!), or differences between
XHTML, HTML 4.01, and HTML5, or a wacky description at w3schools?
Can anyone enlighten me on this, regarding the usage of string>xml?

Much grass,
~cw


-- 
*~ Memento Amori*
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to