www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - embed d in xml instead of html (or at least in addition to)

reply William Kilian <will tk2.com> writes:
Feature suggestion:

Instead of embedding D in an html document, it should be embedded in 
xml. Or at least, embedding D in xml should be added. Then <?d and ?> 
should be used instead of <code> tags. If someone wanted to make a 
php-like interpreted D, that could use <?d also or something different 
like <?id or <?ds

Will
May 01 2005
next sibling parent reply "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
Sounds like a very good idea.

"William Kilian" <will tk2.com> wrote in message 
news:d53gv5$7pf$3 digitaldaemon.com...
 Feature suggestion:

 Instead of embedding D in an html document, it should be embedded 
 in xml. Or at least, embedding D in xml should be added. Then <?d 
 and ?> should be used instead of <code> tags. If someone wanted to 
 make a php-like interpreted D, that could use <?d also or 
 something different like <?id or <?ds

 Will 
May 01 2005
parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
As far I understand Walter's idea....
The intention was to eliminate use of
tools like doxygen so source code in
HTML file is a code and comments in
the same file. Such file is to be acceptable
by brwoser (to view) and by compiler (to compile).
The idea is nice if you have WYSIWYG editor
to allow you to edit such HTML with
D syntax recognition. (Probably it is time for me to
transform my http://blocknote.net into such an editor? :)

Processing instruction <? ?> is a different story.
To be able to deal with <?d ... d?> constructions
you should have an server side environment
and file having <?d ... d?> icludes should be compiled
in the instance of some Servlet class or something.
To be short it is rather matter of Derek's Build.exe
utility than DMD compiler to handle this.

Andrew.



"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message 
news:d54a27$qks$3 digitaldaemon.com...
 Sounds like a very good idea.

 "William Kilian" <will tk2.com> wrote in message 
 news:d53gv5$7pf$3 digitaldaemon.com...
 Feature suggestion:

 Instead of embedding D in an html document, it should be embedded in xml. 
 Or at least, embedding D in xml should be added. Then <?d and ?> should 
 be used instead of <code> tags. If someone wanted to make a php-like 
 interpreted D, that could use <?d also or something different like <?id 
 or <?ds

 Will
May 01 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Andrew Fedoniouk wrote:

  As far I understand Walter's idea....
 The intention was to eliminate use of
 tools like doxygen so source code in
 HTML file is a code and comments in
 the same file. Such file is to be acceptable
 by brwoser (to view) and by compiler (to compile).
I think it works better for examples and for Literate Programming, than what it does for generating API docs from inline documentation... i.e. we still need Doxygen for D. --anders
May 02 2005
prev sibling parent reply William Kilian <will tk2.com> writes:
Andrew Fedoniouk wrote:
 Such file is to be acceptable
 by brwoser (to view) and by compiler (to compile).
I guess using PIs would make it so a standard browser can't display the code. I wasn't thinking straight on that.
 Processing instruction <? ?> is a different story.
 To be able to deal with <?d ... d?> constructions
 you should have an server side environment
 and file having <?d ... d?> icludes should be compiled
 in the instance of some Servlet class or something.
 To be short it is rather matter of Derek's Build.exe
 utility than DMD compiler to handle this.
That's not what I was meaning for the PIs, but that's obviously how they should be used. Will
May 02 2005
parent pragma <pragma_member pathlink.com> writes:
In article <d54qkb$19je$1 digitaldaemon.com>, William Kilian says...
Andrew Fedoniouk wrote:
 Such file is to be acceptable
 by brwoser (to view) and by compiler (to compile).
I guess using PIs would make it so a standard browser can't display the code. I wasn't thinking straight on that.
 Processing instruction <? ?> is a different story.
 To be able to deal with <?d ... d?> constructions
 you should have an server side environment
 and file having <?d ... d?> icludes should be compiled
 in the instance of some Servlet class or something.
 To be short it is rather matter of Derek's Build.exe
 utility than DMD compiler to handle this.
That's not what I was meaning for the PIs, but that's obviously how they should be used.
Hi all. I've actually been stepping over and over this topic with my DSP (D Servlet Pages) project on dsource for almost a year now. (http://svn.dsource.org/svn/projects/dsp) So far the project has a custom XML parser and servlet generator. The language spec is presently offline, as I'm revising it from Alpha2 for the Beta release. The servlet-generator portion works, and I'm presnetly working on finishing a Mango binding so it'll build dll's on the fly. Anyway, DSP documents are XML documents, parsed and processed so the non-DSP tag portions are treated as output for the servlet. The only 'gotcha' with using a Processing Instruction in such a manner is that strict (compliant) parsers will not like seeing PIs after the start of the root element of the document. <?xml verion="1.0"?> <?dsp writefln("this works fine"); ?> <root> <?dsp writefln("compliant parsers don't like this"); ?> </root> DSP is suffering right now due to this limitation, so I'll have to revisit my XML lib and provide a "relaxed" parser that doesn't care so much about being standards compliant when parsing a document. Also, the above exmaple has a nasty tendency to "eat" the PI's it sees. So in order to pass these onto the client, you have to provide a work-around: <!-- emit the following PI to the client --> <?dsp:xml verion="1.0"?> - EricAnderton at yahoo
May 02 2005
prev sibling next sibling parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

William Kilian schrieb am Sun, 01 May 2005 16:16:26 -0500:
 Feature suggestion:

 Instead of embedding D in an html document, it should be embedded in 
 xml. Or at least, embedding D in xml should be added. Then <?d and ?> 
 should be used instead of <code> tags. If someone wanted to make a 
 php-like interpreted D, that could use <?d also or something different 
 like <?id or <?ds
It's a nice idea to add "<?d" handling. Please keep in mind that <code> is intended for display and execution (very usefull for documentations and tutorials) while <?d is intended for execution only. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCdbZM3w+/yD4P9tIRAiNOAKDLqFE6I051FmQnuP3WT3/t/wO2WQCdHRMc 0i16xaiHQhWHok/VSU0kn4c= =UJH+ -----END PGP SIGNATURE-----
May 01 2005
prev sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
William Kilian wrote:

 Instead of embedding D in an html document, it should be embedded in 
 xml. Or at least, embedding D in xml should be added. [...]
As a first step, the examples could at least be converted to XHTML ? http://validator.w3.org/check?uri=http%3A%2F%2Fwww.digitalmars.com%2Fd%2Fhtml.html &charset=utf-8+%28Unicode%2C+worldwide%29&doctype=XHTML+1.0+Transitional --anders
May 02 2005