#157 attDef/desc context disregarded

Ian Rons

I've noticed that in the following example, Roma reads <desc>manuscript folios</desc> as the description for the attribute as a whole, rather than using the default TEI <desc>:

<classSpec ident="att.dimensions" mode="change" module="tei" type="atts">
<attDef ident="unit" mode="change">
<valList mode="replace" type="closed">
<valItem ident="folios">
<desc>manuscript folios</desc>
<valItem ident="lines">
<desc>lines of text</desc>
<valItem ident="words">
<desc>words of text</desc>
<valItem ident="chars">
<desc>characters of text</desc>
<valItem ident="mm">


  • Ian Rons

    Ian Rons - 2010-01-24
    • summary: Parsing --> attDef/desc context disregarded
  • Sebastian Rahtz

    Sebastian Rahtz - 2010-01-25

    that's surprising. I can't see the problem offhand on a quick search through the code, I'll have to dig deeper

  • Ian Rons

    Ian Rons - 2010-01-25

    I took a look and found this sort of thing in romadom.php and docdom.php, which would appear to be the culprit or at least in the vicinity:
    $oDesc = $oChild->getElementsByTagName( 'desc' )->item(0);

  • Ian Rons

    Ian Rons - 2010-01-26

    I should perhaps make it clear by saying that the getElementsByTagName method looks at all descendents, not just children.

  • Sebastian Rahtz

    Sebastian Rahtz - 2010-02-07

    This will require a rather serious re-examination of Roma code, as PHP XML does not seem to give me a simple way of asking "is there a <desc> child". I'll continue looking.

  • Sebastian Rahtz

    Sebastian Rahtz - 2010-02-07
    • status: open --> open-accepted
  • Ian Rons

    Ian Rons - 2010-02-07

    Indeed, this bug seems to have revealed a broader issue. I use PHP a fair bit and tend to use the simplexml PHP extension for everything except xpath queries (although it does simple xpath node queries), and this would make available the children() method.

    To avoid a rewrite, you could perhaps use simplexml_import_dom() followed by SimpleXMLElement::children() in this case, and although I may regret this I am tempted to offer my services to tidy it up in other areas (as per the other bugs I've spotted lately) if you're not that into PHP.

  • Sebastian Rahtz

    Sebastian Rahtz - 2010-02-07

    I am wondering about working around this with childNode; but I am reluctant to spend a lot of time on Roma at the moment, as I really regard it as frozen. If you _can_ spend time to understand the problem and fix it, that would be great. To be honest, I find the code in romadom.php/getAttributeDomByElementInModule incomprehensible now :-{

  • Lou Burnard

    Lou Burnard - 2011-11-09
    • milestone: 871214 --> ROMA

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks