def writeElementNode(derivation, fileNames, target):
 xmlObject = target.xmlObject
 if (xmlObject == None):
  print 'Warning, writeTarget in write could not get xmlObject for:'
  print target
  print derivation.elementNode
  return
 parserDirectory = os.path.dirname(derivation.elementNode.getOwnerDocument().fileName)
 absoluteFolderDirectory = os.path.abspath(os.path.join(parserDirectory, derivation.folderName))
 if ('/models' not in absoluteFolderDirectory):
  print 'Warning, models/ was not in the absolute file path, so for security nothing will be done for:'
  print derivation.elementNode
  print 'For which the absolute folder path is:'
  print absoluteFolderDirectory
  print 'The write tool can only write a file which has models/ in the file path.'
  print 'To write the file, move the file into a folder called model/ or a subfolder which is inside the model folder tree.'
  return
 quantity = evaluate.getEvaluatedInt(1, target, 'quantity')
 for itemIndex in xrange(quantity):
  writeXMLObject(absoluteFolderDirectory, derivation, fileNames, target, xmlObject)

def writeElementNode ( derivation , fileNames , target ) : xmlObject = target . xmlObject if ( xmlObject == None ) : print 'Warning, writeTarget in write could not get xmlObject for:' print target print derivation . elementNode return parserDirectory = os . path . dirname ( derivation . elementNode . getOwnerDocument ( ) . fileName ) absoluteFolderDirectory = os . path . abspath ( os . path . join ( parserDirectory , derivation . folderName ) ) if ( '/models' not in absoluteFolderDirectory ) : print 'Warning, models/ was not in the absolute file path, so for security nothing will be done for:' print derivation . elementNode print 'For which the absolute folder path is:' print absoluteFolderDirectory print 'The write tool can only write a file which has models/ in the file path.' print 'To write the file, move the file into a folder called model/ or a subfolder which is inside the model folder tree.' return quantity = evaluate . getEvaluatedInt ( 1 , target , 'quantity' ) for itemIndex in xrange ( quantity ) : writeXMLObject ( absoluteFolderDirectory , derivation , fileNames , target , xmlObject )
write a quantity of the target .