-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attDef/desc context disregarded #835
Comments
Original comment by: sf_user_ianrons |
that's surprising. I can't see the problem offhand on a quick search through the code, I'll have to dig deeper Original comment by: @sebastianrahtz |
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: Original comment by: sf_user_ianrons |
I should perhaps make it clear by saying that the getElementsByTagName method looks at all descendents, not just children. Original comment by: sf_user_ianrons |
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. Original comment by: @sebastianrahtz |
Original comment by: @sebastianrahtz |
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. Original comment by: sf_user_ianrons |
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 :-{ Original comment by: @sebastianrahtz |
Original comment by: @lb42 |
This issue was originally assigned to SF user: rahtz |
moving to TEIC/Roma-Antiqua#14, closing here |
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">
<attList>
<attDef ident="unit" mode="change">
<valList mode="replace" type="closed">
<valItem ident="folios">
<desc>manuscript folios</desc>
</valItem>
<valItem ident="lines">
<desc>lines of text</desc>
</valItem>
<valItem ident="words">
<desc>words of text</desc>
</valItem>
<valItem ident="chars">
<desc>characters of text</desc>
</valItem>
<valItem ident="mm">
<desc>millimetres</desc>
</valItem>
</valList>
</attDef>
</attList>
<classSpec>
Original comment by: sf_user_ianrons
The text was updated successfully, but these errors were encountered: