Skip to content

Commit

Permalink
Plugin parameter updates
Browse files Browse the repository at this point in the history
Inline 1.1 namespace corrections
Testcase error detection changes for multiple codes
  • Loading branch information
Herm Fischer committed Mar 23, 2015
1 parent 5112490 commit 0478a67
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
8 changes: 5 additions & 3 deletions arelle/ModelDocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,8 @@ def instanceContentsDiscover(self,xbrlElement):
self.unitDiscover(instElement)
elif ns == XbrlConst.link:
pass
elif ns in XbrlConst.ixbrlAll and ln=="relationship":
pass
else: # concept elements
self.factDiscover(instElement, self.modelXbrl.facts)
if len(self.modelXbrl.undefinedFacts) > nextUndefinedFact:
Expand Down Expand Up @@ -1268,7 +1270,7 @@ def locateContinuation(element, chain=None):
for htmlElement in modelXbrl.ixdsHtmlElements:
mdlDoc = htmlElement.modelDocument
# inline 1.0 ixFootnotes, build resources (with ixContinuation)
for modelInlineFootnote in htmlElement.iterdescendants(tag="{http://www.xbrl.org/2008/inlineXBRL}footnote"):
for modelInlineFootnote in htmlElement.iterdescendants(tag=XbrlConst.qnIXbrlFootnote.clarkNotation):
if isinstance(modelInlineFootnote,ModelObject):
# link
linkrole = modelInlineFootnote.get("footnoteLinkRole", XbrlConst.defaultLinkRole)
Expand Down Expand Up @@ -1300,15 +1302,15 @@ def locateContinuation(element, chain=None):
linkrole, arcrole))

# inline 1.1 ixRelationships and ixFootnotes
for modelInlineFootnote in htmlElement.iterdescendants(tag="{http://www.xbrl.org/CR-2013-08-21/inlineXBRL}footnote"):
for modelInlineFootnote in htmlElement.iterdescendants(tag=XbrlConst.qnIXbrl11Footnote.clarkNotation):
if isinstance(modelInlineFootnote,ModelObject):
locateContinuation(modelInlineFootnote)
linkPrototype = LinkPrototype(mdlDoc, mdlDoc.xmlRootElement, XbrlConst.qnLinkFootnoteLink, XbrlConst.defaultLinkRole)
baseSetKey = (XbrlConst.factFootnote,XbrlConst.defaultLinkRole,XbrlConst.qnLinkFootnoteLink, XbrlConst.qnLinkFootnoteArc)
modelXbrl.baseSets[baseSetKey].append(linkPrototype) # allows generating output instance with this loc
linkPrototype.childElements.append(modelInlineFootnote)

for modelInlineRel in htmlElement.iterdescendants(tag="{http://www.xbrl.org/CR-2013-08-21/inlineXBRL}relationship"):
for modelInlineRel in htmlElement.iterdescendants(tag=XbrlConst.qnIXbrl11Relationship.clarkNotation):
if isinstance(modelInlineRel,ModelObject):
linkrole = modelInlineRel.get("linkRole", XbrlConst.defaultLinkRole)
arcrole = modelInlineRel.get("arcrole", XbrlConst.factFootnote)
Expand Down
5 changes: 4 additions & 1 deletion arelle/ModelTestcaseObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ def expected(self):
return XmlUtil.descendantAttr(schemaTestElement, None, "expected", "validity")
errorElement = XmlUtil.descendant(self, None, "error")
if errorElement is not None:
return ModelValue.qname(errorElement, XmlUtil.text(errorElement))
_errorText = XmlUtil.text(errorElement)
if ' ' in _errorText: # list of tokens
return _errorText
return ModelValue.qname(errorElement, _errorText) # turn into a QName
resultElement = XmlUtil.descendant(self, None, "result")
if resultElement is not None:
expected = resultElement.get("expected")
Expand Down
5 changes: 5 additions & 0 deletions arelle/Validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ def determineTestStatus(self, modelTestcaseVariation, modelUnderTest):
break
if expected == "EFM.6.03.02" or expected == "EFM.6.03.08": # 6.03.02 is not testable
status = "pass"
# check if expected is a whitespace separated list of error tokens
if status == "fail" and isinstance(expected,_STR_BASE) and ' ' in expected:
if all(any(testErr == e for testErr in modelUnderTest.errors)
for e in expected.split()):
status = "pass"
if not modelUnderTest.errors and status == "fail":
if modelTestcaseVariation.assertions:
if modelTestcaseVariation.assertions == expected:
Expand Down
2 changes: 2 additions & 0 deletions arelle/XbrlConst.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
qnIXbrl11Numerator = qname("{http://www.xbrl.org/2013/inlineXBRL}numerator")
qnIXbrl11Denominator = qname("{http://www.xbrl.org/2013/inlineXBRL}denominator")
qnIXbrl11Footnote = qname("{http://www.xbrl.org/2013/inlineXBRL}footnote")
qnIXbrl11Relationship = qname("{http://www.xbrl.org/2013/inlineXBRL}relationship")
qnIXbrl11Hidden = qname("{http://www.xbrl.org/2013/inlineXBRL}hidden")
ixAttributes = set(qname(n, noPrefixIsNoNamespace=True)
for n in ("escape", "footnoteRefs", "format", "name", "order", "scale", "sign",
"target", "tupleRef", "tupleID"))
Expand Down

0 comments on commit 0478a67

Please sign in to comment.