RE: [Yaml-core] XML Mapping and some points

Clark C . Evans [mailto:cce@...] wrote:
> I'd like two level approach:
>
> 1. We stick with reverse DNS names,
> esp for Java/.NET compatibility.
So "!tld.domain|type" would be used for a Java 'tld.domain.type'. Yes.
> 2. Allow for absoulte URIs
> (a single colon in them)
> for a resonable level of
> xmlns compatibility.
So "!protocol:whatever|type" would be used for URI based names - like the
HTML one.
> The only problem we have then is how
> to encode Perl class names.
The simplest would be to use one of the above. Remember that 'type' may
contain any chatacters (except '!'), so writing "!org.cpan|Net::FTP" is a
valid name under our rules. And a nice one, too - using '|' make it look so
much better than using '.', and better expresses the intent.
> | If there's no '|' at the start, an implicit 'org.yaml|' is
> | assumed. If
> | there's a '|' without any URI it is taken to be relative to the last
> | explicit absolute space.
>
> Yes. This is better than the last "." thingy.
Right. Well, I;m going over the syntax sectionm especially the transfer
method, anyway - due to formats - so I could just plug this in...
Have fun,
Oren Ben-Kiki

Thread view

Clark C . Evans [mailto:cce@...] wrote:
> <x:p xmlns:x="some-uri">one<x:q>two</x:q></x:p>
>
> --- !!some-uri.p
> - one
> - !!.q
Hmmm. That's not a private type, exactly...
> How much flexibility do I have
> in the type names... can I quote them?
>
> !!"some-uri".x
Private names can contain anything whatsoever except for a '!' character.
Public names are currently milited to IANA or DNS names. The above isn't a
private type; using a URI means it is globally unique. However:
!{http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd}p
Is not currently legal. It also doesn't combine with our relative names
scheme because it isn't an absolute DNS name.
We could just add it as a valid type name, of course, and extend the
relative type mechanism to recognize it:
!{http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd}p
- !.head
- !.meta
...
- !.body
- !.p
- This is the first paragraph...
In fact we could drop our absolute DNS based scheme altogether if we did
that... Or we could compine the two. This would require two things:
- Use some other way to separate the namespace from the name (the {} is the
way that many people write namespaced XML names - but it is just a
convention). I suggest '|'.
- Make the protocol and path optional; allow just a DNS name (we could say
it is a shorthand for 'http:' and '/' or whatever).
This would allow us writing:
root: !my.company|invoice
product:
description: !http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd|p
- 'A '
- !|em green
- ' ball'
to: !|client
...
If there's no '|' at the start, an implicit 'org.yaml|' is assumed. If
there's a '|' without any URI it is taken to be relative to the last
explicit absolute space.
> This would allow a full injection of XML into YAML.
Remember comments, processing instructions, entities, CDATA sections... But
I agree it is a good place to start.
Have fun,
Oren Ben-Kiki

Clark C . Evans [mailto:cce@...] wrote:
> I'd like two level approach:
>
> 1. We stick with reverse DNS names,
> esp for Java/.NET compatibility.
So "!tld.domain|type" would be used for a Java 'tld.domain.type'. Yes.
> 2. Allow for absoulte URIs
> (a single colon in them)
> for a resonable level of
> xmlns compatibility.
So "!protocol:whatever|type" would be used for URI based names - like the
HTML one.
> The only problem we have then is how
> to encode Perl class names.
The simplest would be to use one of the above. Remember that 'type' may
contain any chatacters (except '!'), so writing "!org.cpan|Net::FTP" is a
valid name under our rules. And a nice one, too - using '|' make it look so
much better than using '.', and better expresses the intent.
> | If there's no '|' at the start, an implicit 'org.yaml|' is
> | assumed. If
> | there's a '|' without any URI it is taken to be relative to the last
> | explicit absolute space.
>
> Yes. This is better than the last "." thingy.
Right. Well, I;m going over the syntax sectionm especially the transfer
method, anyway - due to formats - so I could just plug this in...
Have fun,
Oren Ben-Kiki

| So "!tld.domain|type" would be used for a Java 'tld.domain.type'. Yes.
| So "!protocol:whatever|type" would be used for URI based names
| !org.cpan|Net::FTP" is a valid name under our rules.
Nice.
| Right. Well, I;m going over the syntax sectionm especially the transfer
| method, anyway - due to formats - so I could just plug this in...
Please this is a huge improvement.
;) Clark

| - Use some other way to separate the namespace from the
| name (the {} is the way that many people write namespaced
| XML names - but it is just a convention). I suggest '|'.
Great. I like it.
| - Make the protocol and path optional; allow just a DNS name (we could say
| it is a shorthand for 'http:' and '/' or whatever).
I'd like two level approach:
1. We stick with reverse DNS names,
esp for Java/.NET compatibility.
2. Allow for absoulte URIs
(a single colon in them)
for a resonable level of
xmlns compatibility.
The only problem we have then is how
to encode Perl class names.
| root: !my.company|invoice
Where my is a tld, and company is a registrant
in the TLD, correct?
| product:
| description: !http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd|p
| - 'A '
| - !|em green
| - ' ball'
| to: !|client
| ...
Exactly.
| If there's no '|' at the start, an implicit 'org.yaml|' is assumed. If
| there's a '|' without any URI it is taken to be relative to the last
| explicit absolute space.
Yes. This is better than the last "." thingy.
| > This would allow a full injection of XML into YAML.
|
| Remember comments, processing instructions, entities, CDATA sections... But
| I agree it is a good place to start.
Yep.
Clark
--
Clark C. Evans Axista, Inc.
http://www.axista.com 800.926.5525
XCOLLA Collaborative Project Management Software