[x3d-public] dual use of script tag in HTML environment
yves.piguet at gmail.com
Fri Nov 11 14:02:56 PST 2016
On 11 Nov 2016, at 20:40, Andreas Plesch <andreasplesch at gmail.com> wrote:
> On 11 Nov 2016, at 20:40, Andreas Plesch <andreasplesch at gmail.com> wrote:
> On Fri, Nov 11, 2016 at 1:27 PM, Yves Piguet <yves.piguet at gmail.com <mailto:yves.piguet at gmail.com>> wrote:
> Sorry if this has already been discussed. Couldn't you define a namespace-like prefix for all elements, such as "x3d:"? Maybe optional for elements which don't cause a compatibility problem with element tag names already defined for other purposes.
> Yes, that would be a solution and html5 custom elements need to have such prefix with a minus instead of a colon. But since script is the only element which is affected, there is a desire to avoid that in order to stay x3d spec. conforming.
But it wouldn't be a custom element, so one shouldn't have a hyphen in a standard x3d tag. Or if you consider x3d in html5 as a custom application, you must have hyphens everywhere.
> In HTML5, namespaces don't exist (see e.g. <https://dev.w3.org/html5/spec-LC/syntax.html#elements-0 <https://dev.w3.org/html5/spec-LC/syntax.html#elements-0>>): the actual tag name of X3D script elements would be "x3d:script". Script source code should be put in cdata fragments <https://dev.w3.org/html5/spec-LC/syntax.html#cdata-sections <https://dev.w3.org/html5/spec-LC/syntax.html#cdata-sections>>.
> No, in html5 CDATA sections are only used in 'foreign content', see https://dev.w3.org/html5/spec-LC/syntax.html#cdata-sections <https://dev.w3.org/html5/spec-LC/syntax.html#cdata-sections> :
> 3. CDATA sections can only be used in foreign content (MathML or SVG)
> and <script> is considered raw text content.
I mean it would be foreign content if x3d's script element is made distinct with a different name, wouldn't it? Then you can keep child elements for fields.
> In xhtml, one should use CDATA for script source code.
> In XHTML, a valid xml namespace would be declared and used.
> For xhtml, there is no problem if the type attribute of the script node is for example 'application/vrmlscript' .
> What do you think about the fields attribute proposal for x3d scripts nodes ?
I don't have much experience with the xml encoding. In principle I'd rather keep everything as close to v3 as possible.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the x3d-public