What kind of XML is allowed in egXML?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

What kind of XML is allowed in egXML?

Joey Takeda
Hi there,

Apologies if these questions have been asked before, but I'm curious about the relationship between the TEI, TEI Examples namespace, and <egXML>.

My main question is: What kind of XML is allowed in <egXML>? The Guidelines states that <egXML> in the TEI Examples namespace (http://www.tei-c.org/ns/Examples) should contain TEI and when "this element is used outside this context, a different namespace or none at all may be preferable." So, if I understand correctly, to embed some non-TEI well-formed bit of XML within your TEI document, you must have a customization for a new egXML in a new namespace?

In other words: putting fragments of other bits of XML in your TEI is thus always a break in TEI conformance, since either you are abusing the TEI Examples namespace by putting non-TEI stuff in it or you are creating a new egXML element in a new namespace, which then makes your ODD customization an extension. Is that correct and is that what is intended?

The second question, which is perhaps a bug or something else and so it might not belong here, is that the odd2lite transformation puts the content model of an element in an <eg> block and not an <egXML> block. For example (from the <char> elementSpec):

<eg xml:space="preserve">
<content>
 <sequence>
  <elementRef key="charName" minOccurs="0"/>
  <classRef key="model.descLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <elementRef key="charProp" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="mapping" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="figure" minOccurs="0"
   maxOccurs="unbounded"/>
  <classRef key="model.graphicLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <classRef key="model.noteLike"
   minOccurs="0" maxOccurs="unbounded"/>
 </sequence>
</content>
    </eg>

Since this is Pure TEI ODD, then it should be perfectly legal to put this in an <egXML> instead of a <eg>, right? (If you try and disable-output-escaping, the XML is malformed because there are sneaky non-breaking spaces in there [for formatting reasons, I presume].)

Best,
Joey
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

James Cummings-5

Hi Joey,


I think that remark on the egXML specification reference page is merely to suggest that in contexts other than the TEI people may prefer to use a different namespace rather than have it appear as if the examples are meant to be TEI ones.  The egXML element is mostly used in TEI ODD customisation writing, and so is optimised for this use. However, that does not mean the content of it needs to be TEI XML! You can put any well-formed XML fragment in there.  That XML can use whatever XML Namespaces it wants.  For example:


===

<egXML xmlns="http://www.tei-c.org/ns/Examples">
   <quantum xmlns="http://james.blushingbunny.net/ns.html">
      <vortex>
         <bunny>
            Some text here
         </bunny>
      </vortex>
   </quantum>
</egXML>
===


Is perfectly valid TEI (well, when in an otherwise valid TEI document) even though the egXML content is nothing to do with the TEI.


With the odd2lite I'm assuming this is because it has no choice. I don't their TEI Lite has egXML as an element, does it?


Hope that helps,


James 


--

Dr James Cummings, [hidden email]

School of English Literature, Language, and Linguistics, Newcastle University




From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
Sent: 23 July 2018 23:43
To: [hidden email]
Subject: What kind of XML is allowed in egXML?
 
Hi there,

Apologies if these questions have been asked before, but I'm curious about the relationship between the TEI, TEI Examples namespace, and <egXML>.

My main question is: What kind of XML is allowed in <egXML>? The Guidelines states that <egXML> in the TEI Examples namespace (http://www.tei-c.org/ns/Examples) should contain TEI and when "this element is used outside this context, a different namespace or none at all may be preferable." So, if I understand correctly, to embed some non-TEI well-formed bit of XML within your TEI document, you must have a customization for a new egXML in a new namespace?

In other words: putting fragments of other bits of XML in your TEI is thus always a break in TEI conformance, since either you are abusing the TEI Examples namespace by putting non-TEI stuff in it or you are creating a new egXML element in a new namespace, which then makes your ODD customization an extension. Is that correct and is that what is intended?

The second question, which is perhaps a bug or something else and so it might not belong here, is that the odd2lite transformation puts the content model of an element in an <eg> block and not an <egXML> block. For example (from the <char> elementSpec):

<eg xml:space="preserve">
<content>
 <sequence>
  <elementRef key="charName" minOccurs="0"/>
  <classRef key="model.descLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <elementRef key="charProp" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="mapping" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="figure" minOccurs="0"
   maxOccurs="unbounded"/>
  <classRef key="model.graphicLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <classRef key="model.noteLike"
   minOccurs="0" maxOccurs="unbounded"/>
 </sequence>
</content>
    </eg>

Since this is Pure TEI ODD, then it should be perfectly legal to put this in an <egXML> instead of a <eg>, right? (If you try and disable-output-escaping, the XML is malformed because there are sneaky non-breaking spaces in there [for formatting reasons, I presume].)

Best,
Joey
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

Joey Takeda
Hi James,

Thanks for the reply! That's very helpful. I think where I was getting tripped up on this part: "this element **declares itself and its content** as belonging to the namespace http://www.tei-c.org/ns/Examples. This **enables the content of the element to be validated independently against the TEI scheme**. Where this element is used outside **this context**, a different namespace or none at all may be preferable." (emphasis mine). As far as I understand it, that means that everything in the Examples namespace should be TEI. So, if you were to put an element from another namespace in the document:

<tei:p>Here is an example of an HTML article:
<teix:egXML>
<article><h2>My Article</h2></article>
</teix:egXML>
</tei:p>

does that mean it must declare itself in the XHTML namespace?  Does that mean that you shouldn't be declaring elements in teix unless they are valid w/r/t some TEI schema . . . tei_all or the project schema?

And in terms of the odd2lite transformation, there are <egXML> blocks in the document (even though I don't believe Lite allows them); I think the <eg>s are there because modules and other bits in the serialized content model are turned into links in the Guidelines. (That said, I don't think the odd2lite transformation is actually valid against Lite anyways--see https://github.com/TEIC/Stylesheets/issues/328). 

Best,
Joey

On Tue, Jul 24, 2018 at 4:40 AM James Cummings <[hidden email]> wrote:

Hi Joey,


I think that remark on the egXML specification reference page is merely to suggest that in contexts other than the TEI people may prefer to use a different namespace rather than have it appear as if the examples are meant to be TEI ones.  The egXML element is mostly used in TEI ODD customisation writing, and so is optimised for this use. However, that does not mean the content of it needs to be TEI XML! You can put any well-formed XML fragment in there.  That XML can use whatever XML Namespaces it wants.  For example:


===

      <vortex>
         <bunny>
            Some text here
         </bunny>
      </vortex>
   </quantum>
</egXML>
===


Is perfectly valid TEI (well, when in an otherwise valid TEI document) even though the egXML content is nothing to do with the TEI.


With the odd2lite I'm assuming this is because it has no choice. I don't their TEI Lite has egXML as an element, does it?


Hope that helps,


James 


--

Dr James Cummings, [hidden email]

School of English Literature, Language, and Linguistics, Newcastle University




From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
Sent: 23 July 2018 23:43
To: [hidden email]
Subject: What kind of XML is allowed in egXML?
 
Hi there,

Apologies if these questions have been asked before, but I'm curious about the relationship between the TEI, TEI Examples namespace, and <egXML>.

My main question is: What kind of XML is allowed in <egXML>? The Guidelines states that <egXML> in the TEI Examples namespace (http://www.tei-c.org/ns/Examples) should contain TEI and when "this element is used outside this context, a different namespace or none at all may be preferable." So, if I understand correctly, to embed some non-TEI well-formed bit of XML within your TEI document, you must have a customization for a new egXML in a new namespace?

In other words: putting fragments of other bits of XML in your TEI is thus always a break in TEI conformance, since either you are abusing the TEI Examples namespace by putting non-TEI stuff in it or you are creating a new egXML element in a new namespace, which then makes your ODD customization an extension. Is that correct and is that what is intended?

The second question, which is perhaps a bug or something else and so it might not belong here, is that the odd2lite transformation puts the content model of an element in an <eg> block and not an <egXML> block. For example (from the <char> elementSpec):

<eg xml:space="preserve">
<content>
 <sequence>
  <elementRef key="charName" minOccurs="0"/>
  <classRef key="model.descLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <elementRef key="charProp" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="mapping" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="figure" minOccurs="0"
   maxOccurs="unbounded"/>
  <classRef key="model.graphicLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <classRef key="model.noteLike"
   minOccurs="0" maxOccurs="unbounded"/>
 </sequence>
</content>
    </eg>

Since this is Pure TEI ODD, then it should be perfectly legal to put this in an <egXML> instead of a <eg>, right? (If you try and disable-output-escaping, the XML is malformed because there are sneaky non-breaking spaces in there [for formatting reasons, I presume].)

Best,
Joey
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

James Cummings-5

Hi Joey,


I see what you mean and think that the wording could be clarified to not dissuade people putting non-TEI material in there.


What your markup in that example says to me is that, regardless of it not being namespaced prefixed with tei: that the content of that egXML is in TEI. This doesn't mean that you shouldn't put non-TEI XML in there just that you should add its namespace for clarity. So I guess in that case:


===

<tei:p>Here is an example of an HTML article:
<teix:egXML>
<article xmlns="http://www.w3.org/1999/xhtml"><h2>My Article</h2></article>
</teix:egXML>
</tei:p>
===
or
===
<tei:p>Here is an example of an HTML article:
<teix:egXML xmlns:html="http://www.w3.org/1999/xhtml">
<html:article><html:h2>My Article</html:h2></html:article>
</teix:egXML>
</tei:p>
===

Except of course you chose HTML5 didn't you? (You did that on purpose, I bet!)  The assumption with people using egXML, I think, is that they are providing examples of XML, whereas some would argue that HTML5 isn't really XML. I'd assume that anyone doing XML properly would use a namespace, they certainly wouldn't just get rid of them from world wide recommendations for facile arguments of simplicity. ;-) But assuming your HTML5 is well-formed XML then the W3C still seems to recommend the xhtml namespace as the HTML5 namespace.

You shouldn't have to change your schema or ODD customisation to do any of this though.


Many thanks,

James 


--

Dr James Cummings, [hidden email]

School of English Literature, Language, and Linguistics, Newcastle University


From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
Sent: 24 July 2018 18:15:38
To: [hidden email]
Subject: Re: What kind of XML is allowed in egXML?
 
Hi James,

Thanks for the reply! That's very helpful. I think where I was getting tripped up on this part: "this element **declares itself and its content** as belonging to the namespace http://www.tei-c.org/ns/Examples. This **enables the content of the element to be validated independently against the TEI scheme**. Where this element is used outside **this context**, a different namespace or none at all may be preferable." (emphasis mine). As far as I understand it, that means that everything in the Examples namespace should be TEI. So, if you were to put an element from another namespace in the document:

<tei:p>Here is an example of an HTML article:
<teix:egXML>
<article><h2>My Article</h2></article>
</teix:egXML>
</tei:p>

does that mean it must declare itself in the XHTML namespace?  Does that mean that you shouldn't be declaring elements in teix unless they are valid w/r/t some TEI schema . . . tei_all or the project schema?

And in terms of the odd2lite transformation, there are <egXML> blocks in the document (even though I don't believe Lite allows them); I think the <eg>s are there because modules and other bits in the serialized content model are turned into links in the Guidelines. (That said, I don't think the odd2lite transformation is actually valid against Lite anyways--see https://github.com/TEIC/Stylesheets/issues/328). 

Best,
Joey

On Tue, Jul 24, 2018 at 4:40 AM James Cummings <[hidden email]> wrote:

Hi Joey,


I think that remark on the egXML specification reference page is merely to suggest that in contexts other than the TEI people may prefer to use a different namespace rather than have it appear as if the examples are meant to be TEI ones.  The egXML element is mostly used in TEI ODD customisation writing, and so is optimised for this use. However, that does not mean the content of it needs to be TEI XML! You can put any well-formed XML fragment in there.  That XML can use whatever XML Namespaces it wants.  For example:


===

      <vortex>
         <bunny>
            Some text here
         </bunny>
      </vortex>
   </quantum>
</egXML>
===


Is perfectly valid TEI (well, when in an otherwise valid TEI document) even though the egXML content is nothing to do with the TEI.


With the odd2lite I'm assuming this is because it has no choice. I don't their TEI Lite has egXML as an element, does it?


Hope that helps,


James 


--

Dr James Cummings, [hidden email]

School of English Literature, Language, and Linguistics, Newcastle University




From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
Sent: 23 July 2018 23:43
To: [hidden email]
Subject: What kind of XML is allowed in egXML?
 
Hi there,

Apologies if these questions have been asked before, but I'm curious about the relationship between the TEI, TEI Examples namespace, and <egXML>.

My main question is: What kind of XML is allowed in <egXML>? The Guidelines states that <egXML> in the TEI Examples namespace (http://www.tei-c.org/ns/Examples) should contain TEI and when "this element is used outside this context, a different namespace or none at all may be preferable." So, if I understand correctly, to embed some non-TEI well-formed bit of XML within your TEI document, you must have a customization for a new egXML in a new namespace?

In other words: putting fragments of other bits of XML in your TEI is thus always a break in TEI conformance, since either you are abusing the TEI Examples namespace by putting non-TEI stuff in it or you are creating a new egXML element in a new namespace, which then makes your ODD customization an extension. Is that correct and is that what is intended?

The second question, which is perhaps a bug or something else and so it might not belong here, is that the odd2lite transformation puts the content model of an element in an <eg> block and not an <egXML> block. For example (from the <char> elementSpec):

<eg xml:space="preserve">
<content>
 <sequence>
  <elementRef key="charName" minOccurs="0"/>
  <classRef key="model.descLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <elementRef key="charProp" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="mapping" minOccurs="0"
   maxOccurs="unbounded"/>
  <elementRef key="figure" minOccurs="0"
   maxOccurs="unbounded"/>
  <classRef key="model.graphicLike"
   minOccurs="0" maxOccurs="unbounded"/>
  <classRef key="model.noteLike"
   minOccurs="0" maxOccurs="unbounded"/>
 </sequence>
</content>
    </eg>

Since this is Pure TEI ODD, then it should be perfectly legal to put this in an <egXML> instead of a <eg>, right? (If you try and disable-output-escaping, the XML is malformed because there are sneaky non-breaking spaces in there [for formatting reasons, I presume].)

Best,
Joey
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

Martin Holmes
I have an ODD file for an XHTML project, and I'm putting all my examples
of XHTML in the TEI Example namespace, not the XHTML namespace, for the
obvious reason that when the ODD gets processed, I want those elements
to be ignored by the standard processing applied to actual XHTML in the
project. I believe that's the main reason that TEI element in egXML are
in the eg namespace rather than the TEI namespace.

I could create a special namespace for XHTML examples, but I've always
assumed that the egXML namespace is there for this purpose.

Cheers,
Martin

On 2018-07-30 03:15 AM, James Cummings wrote:

> Hi Joey,
>
>
> I see what you mean and think that the wording could be clarified to not dissuade people putting non-TEI material in there.
>
>
> What your markup in that example says to me is that, regardless of it not being namespaced prefixed with tei: that the content of that egXML is in TEI. This doesn't mean that you shouldn't put non-TEI XML in there just that you should add its namespace for clarity. So I guess in that case:
>
>
> ===
>
> <tei:p>Here is an example of an HTML article:
> <teix:egXML>
> <article xmlns="http://www.w3.org/1999/xhtml"><h2>My Article</h2></article>
> </teix:egXML>
> </tei:p>
> ===
> or
> ===
> <tei:p>Here is an example of an HTML article:
> <teix:egXML xmlns:html="http://www.w3.org/1999/xhtml">
> <html:article><html:h2>My Article</html:h2></html:article>
> </teix:egXML>
> </tei:p>
> ===
>
> Except of course you chose HTML5 didn't you? (You did that on purpose, I bet!)  The assumption with people using egXML, I think, is that they are providing examples of XML, whereas some would argue that HTML5 isn't really XML. I'd assume that anyone doing XML properly would use a namespace, they certainly wouldn't just get rid of them from world wide recommendations for facile arguments of simplicity. ;-) But assuming your HTML5 is well-formed XML then the W3C still seems to recommend the xhtml namespace as the HTML5 namespace.
>
> You shouldn't have to change your schema or ODD customisation to do any of this though.
>
>
> Many thanks,
>
> James
>
>
> --
>
> Dr James Cummings, [hidden email]
>
> School of English Literature, Language, and Linguistics, Newcastle University
>
> ________________________________
> From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
> Sent: 24 July 2018 18:15:38
> To: [hidden email]
> Subject: Re: What kind of XML is allowed in egXML?
>
> Hi James,
>
> Thanks for the reply! That's very helpful. I think where I was getting tripped up on this part: "this element **declares itself and its content** as belonging to the namespace http://www.tei-c.org/ns/Examples. This **enables the content of the element to be validated independently against the TEI scheme**. Where this element is used outside **this context**, a different namespace or none at all may be preferable." (emphasis mine). As far as I understand it, that means that everything in the Examples namespace should be TEI. So, if you were to put an element from another namespace in the document:
>
> <tei:p>Here is an example of an HTML article:
> <teix:egXML>
> <article><h2>My Article</h2></article>
> </teix:egXML>
> </tei:p>
>
> does that mean it must declare itself in the XHTML namespace?  Does that mean that you shouldn't be declaring elements in teix unless they are valid w/r/t some TEI schema . . . tei_all or the project schema?
>
> And in terms of the odd2lite transformation, there are <egXML> blocks in the document (even though I don't believe Lite allows them); I think the <eg>s are there because modules and other bits in the serialized content model are turned into links in the Guidelines. (That said, I don't think the odd2lite transformation is actually valid against Lite anyways--see https://github.com/TEIC/Stylesheets/issues/328).
>
> Best,
> Joey
>
> On Tue, Jul 24, 2018 at 4:40 AM James Cummings <[hidden email]<mailto:[hidden email]>> wrote:
>
> Hi Joey,
>
>
> I think that remark on the egXML specification reference page is merely to suggest that in contexts other than the TEI people may prefer to use a different namespace rather than have it appear as if the examples are meant to be TEI ones.  The egXML element is mostly used in TEI ODD customisation writing, and so is optimised for this use. However, that does not mean the content of it needs to be TEI XML! You can put any well-formed XML fragment in there.  That XML can use whatever XML Namespaces it wants.  For example:
>
>
> ===
>
> <egXML xmlns="http://www.tei-c.org/ns/Examples">
>     <quantum xmlns="http://james.blushingbunny.net/ns.html">
>        <vortex>
>           <bunny>
>              Some text here
>           </bunny>
>        </vortex>
>     </quantum>
> </egXML>
> ===
>
>
> Is perfectly valid TEI (well, when in an otherwise valid TEI document) even though the egXML content is nothing to do with the TEI.
>
>
> With the odd2lite I'm assuming this is because it has no choice. I don't their TEI Lite has egXML as an element, does it?
>
>
> Hope that helps,
>
>
> James
>
>
> --
>
> Dr James Cummings, [hidden email]<mailto:[hidden email]>
>
> School of English Literature, Language, and Linguistics, Newcastle University
>
>
> ________________________________
> From: TEI (Text Encoding Initiative) public discussion list <[hidden email]<mailto:[hidden email]>> on behalf of Joey Takeda <[hidden email]<mailto:[hidden email]>>
> Sent: 23 July 2018 23:43
> To: [hidden email]<mailto:[hidden email]>
> Subject: What kind of XML is allowed in egXML?
>
> Hi there,
>
> Apologies if these questions have been asked before, but I'm curious about the relationship between the TEI, TEI Examples namespace, and <egXML>.
>
> My main question is: What kind of XML is allowed in <egXML>? The Guidelines states that <egXML> in the TEI Examples namespace (http://www.tei-c.org/ns/Examples) should contain TEI and when "this element is used outside this context, a different namespace or none at all may be preferable." So, if I understand correctly, to embed some non-TEI well-formed bit of XML within your TEI document, you must have a customization for a new egXML in a new namespace?
>
> In other words: putting fragments of other bits of XML in your TEI is thus always a break in TEI conformance, since either you are abusing the TEI Examples namespace by putting non-TEI stuff in it or you are creating a new egXML element in a new namespace, which then makes your ODD customization an extension. Is that correct and is that what is intended?
>
> The second question, which is perhaps a bug or something else and so it might not belong here, is that the odd2lite transformation puts the content model of an element in an <eg> block and not an <egXML> block. For example (from the <char> elementSpec):
>
> <eg xml:space="preserve">
> <content>
>   <sequence>
>    <elementRef key="charName" minOccurs="0"/>
>    <classRef key="model.descLike"
>     minOccurs="0" maxOccurs="unbounded"/>
>    <elementRef key="charProp" minOccurs="0"
>     maxOccurs="unbounded"/>
>    <elementRef key="mapping" minOccurs="0"
>     maxOccurs="unbounded"/>
>    <elementRef key="figure" minOccurs="0"
>     maxOccurs="unbounded"/>
>    <classRef key="model.graphicLike"
>     minOccurs="0" maxOccurs="unbounded"/>
>    <classRef key="model.noteLike"
>     minOccurs="0" maxOccurs="unbounded"/>
>   </sequence>
> </content>
>      </eg>
>
> Since this is Pure TEI ODD, then it should be perfectly legal to put this in an <egXML> instead of a <eg>, right? (If you try and disable-output-escaping, the XML is malformed because there are sneaky non-breaking spaces in there [for formatting reasons, I presume].)
>
> Best,
> Joey
>
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

Joey Takeda
In reply to this post by Joey Takeda
Hi James and Martin,

James, I certainly agree that it should be namespaced differently than the TEI stuff, but I agree with Martin, as well, that it has to be in a different namespace to avoid unintended processing. But, what about when you have to show mixed namespaced stuff, like in this example from the <constraint> elementSpec:

<exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples">
      <constraintSpec ident="isoconstraint" scheme="schematron">
        <constraint>
          <assert xmlns="http://purl.oclc.org/dsdl/schematron" test="tei:fileDesc/tei:titleStmt/tei:title[@type='main']"> a main title must be supplied
          </assert>
        </constraint>
      </constraintSpec>
    </egXML>
  </exemplum>

?

Apologies for opening a can of worms :-)!

Best,
Joey
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

James Cummings-5

Hi Joey and Martin,


I accept Martin's use-case as well. With the example of a schematron constraint then with the sch:assert then what you are gaining by putting it in the correct namespace is clear documentation, what you are losing, perhaps, is the validation of that piece of schematron by some external processor? Though presumably whatever is processing this egXML could special case certain content inside egXML to ignore processing it as though it were schematron or in Martin's example HTML. I don't like special-case processing but egXML seems like a reasonable place for it.  You'll notice that in the specification file for egXML that the examples there don't put the egXML into the examples namespace when they are nested: https://github.com/TEIC/TEI/blob/dev/P5/Source/Specs/egXML.xml#L67-L91. But really this is because our processing treats things in the examples namespace differently in the context of the egXML element. We could special-case the stylesheets processing for this situation allowing us to have an egXML inside an egXML both properly in the examples namespace. Is it worth it? 


Many thanks,

James 


--

Dr James Cummings, [hidden email]

School of English Literature, Language, and Linguistics, Newcastle University


From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
Sent: 30 July 2018 20:48:35
To: [hidden email]
Subject: Re: What kind of XML is allowed in egXML?
 
Hi James and Martin,

James, I certainly agree that it should be namespaced differently than the TEI stuff, but I agree with Martin, as well, that it has to be in a different namespace to avoid unintended processing. But, what about when you have to show mixed namespaced stuff, like in this example from the <constraint> elementSpec:

<exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples">
      <constraintSpec ident="isoconstraint" scheme="schematron">
        <constraint>
          <assert xmlns="http://purl.oclc.org/dsdl/schematron" test="tei:fileDesc/tei:titleStmt/tei:title[@type='main']"> a main title must be supplied
          </assert>
        </constraint>
      </constraintSpec>
    </egXML>
  </exemplum>

?

Apologies for opening a can of worms :-)!

Best,
Joey
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

Martin Holmes
I think for mixed-namespace stuff where the namespace URI forms part of
the example, I'd avoid egXML completely, and use (say) the eg element
with escaped content.

For validating the content of plausibly-valid fragments in egXMLs, I
think the best approach is to extract them into an external file,
restore the original namespace(s), and then validate (which is what we
do in the Map of London project -- Joey wrote most of the code for that,
IIRC).

Cheers,
Martin

On 2018-07-31 06:26 AM, James Cummings wrote:

> Hi Joey and Martin,
>
>
> I accept Martin's use-case as well. With the example of a schematron constraint then with the sch:assert then what you are gaining by putting it in the correct namespace is clear documentation, what you are losing, perhaps, is the validation of that piece of schematron by some external processor? Though presumably whatever is processing this egXML could special case certain content inside egXML to ignore processing it as though it were schematron or in Martin's example HTML. I don't like special-case processing but egXML seems like a reasonable place for it.  You'll notice that in the specification file for egXML that the examples there don't put the egXML into the examples namespace when they are nested: https://github.com/TEIC/TEI/blob/dev/P5/Source/Specs/egXML.xml#L67-L91. But really this is because our processing treats things in the examples namespace differently in the context of the egXML element. We could special-case the stylesheets processing for this situation allowing us to have an egXML inside an egXML both properly in the examples namespace. Is it worth it?
>
>
> Many thanks,
>
> James
>
>
> --
>
> Dr James Cummings, [hidden email]
>
> School of English Literature, Language, and Linguistics, Newcastle University
>
> ________________________________
> From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
> Sent: 30 July 2018 20:48:35
> To: [hidden email]
> Subject: Re: What kind of XML is allowed in egXML?
>
> Hi James and Martin,
>
> James, I certainly agree that it should be namespaced differently than the TEI stuff, but I agree with Martin, as well, that it has to be in a different namespace to avoid unintended processing. But, what about when you have to show mixed namespaced stuff, like in this example from the <constraint> elementSpec:
>
> <exemplum xml:lang="en">
>      <egXML xmlns="http://www.tei-c.org/ns/Examples">
>        <constraintSpec ident="isoconstraint" scheme="schematron">
>          <constraint>
>            <assert xmlns="http://purl.oclc.org/dsdl/schematron" test="tei:fileDesc/tei:titleStmt/tei:title[@type='main']"> a main title must be supplied
>            </assert>
>          </constraint>
>        </constraintSpec>
>      </egXML>
>    </exemplum>
>
> ?
>
> Apologies for opening a can of worms :-)!
>
> Best,
> Joey
>
Reply | Threaded
Open this post in threaded view
|

Re: What kind of XML is allowed in egXML?

Joey Takeda
In reply to this post by James Cummings-5
Hi James,

That makes a lot of sense to me. So, just to summarize from this thread, I think the main thing is that some small clarification that the teix namespace is not necessarily just for TEI but can be used for any XML. However, if you use non-TEI items in the teix namespace, then validation becomes difficult. Perhaps the @scheme attribute should be added to egXML to clarify this. 

And thanks for pointing to the guidelines example! I see what you mean here, but I'm not sure I'm following exactly: the nested <egXML> is in the Examples namespace by virtue of it being within an <egXML> in the examples namespace, no? Perhaps it's not meant to be in the teix namespace (maybe it should just be in the null namespace)? I raised a ticket about this earlier, since the nested <egXML>s in the spec cause validity errors in a compiled ODD: https://github.com/TEIC/TEI/issues/1798.

Best,
Joey

On Tue, Jul 31, 2018 at 6:26 AM James Cummings <[hidden email]> wrote:

Hi Joey and Martin,


I accept Martin's use-case as well. With the example of a schematron constraint then with the sch:assert then what you are gaining by putting it in the correct namespace is clear documentation, what you are losing, perhaps, is the validation of that piece of schematron by some external processor? Though presumably whatever is processing this egXML could special case certain content inside egXML to ignore processing it as though it were schematron or in Martin's example HTML. I don't like special-case processing but egXML seems like a reasonable place for it.  You'll notice that in the specification file for egXML that the examples there don't put the egXML into the examples namespace when they are nested: https://github.com/TEIC/TEI/blob/dev/P5/Source/Specs/egXML.xml#L67-L91. But really this is because our processing treats things in the examples namespace differently in the context of the egXML element. We could special-case the stylesheets processing for this situation allowing us to have an egXML inside an egXML both properly in the examples namespace. Is it worth it? 


Many thanks,

James 


--

Dr James Cummings, [hidden email]

School of English Literature, Language, and Linguistics, Newcastle University


From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Joey Takeda <[hidden email]>
Sent: 30 July 2018 20:48:35
To: [hidden email]
Subject: Re: What kind of XML is allowed in egXML?
 
Hi James and Martin,

James, I certainly agree that it should be namespaced differently than the TEI stuff, but I agree with Martin, as well, that it has to be in a different namespace to avoid unintended processing. But, what about when you have to show mixed namespaced stuff, like in this example from the <constraint> elementSpec:

<exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples">
      <constraintSpec ident="isoconstraint" scheme="schematron">
        <constraint>
          <assert xmlns="http://purl.oclc.org/dsdl/schematron" test="tei:fileDesc/tei:titleStmt/tei:title[@type='main']"> a main title must be supplied
          </assert>
        </constraint>
      </constraintSpec>
    </egXML>
  </exemplum>

?

Apologies for opening a can of worms :-)!

Best,
Joey