Open egli opened 5 years ago
If the source XML contains an entity such as
<!ENTITY brlnoblank "<brl:select><brl:when-braille/><brl:otherwise> </brl:otherwise></brl:select>">
then validation when importing the xml from Alfresco fails. The suspicion is that the Python xsl transformation fails to handle the namespaces in the entity properly.
Solution:
Instead of using the lxml transform method just shell out to the standard xsl engine that the rest of the program uses, i.e. something along the lines of https://github.com/sbsdev/daisyproducer/blob/master/daisyproducer/documents/external.py#L132:
command = ( "java", "-jar", join(settings.EXTERNAL_PATH, 'dtbook2sbsform', 'lib', 'saxon9he.jar'), "-xsl:%s" % xsl, "-s:%s" % source) command = command + tuple(args) command = command + tuple(["%s=%s" % (key,value) for key,value in params.iteritems()]) Popen(command, stderr=PIPE, stdout=PIPE)
If the source XML contains an entity such as
then validation when importing the xml from Alfresco fails. The suspicion is that the Python xsl transformation fails to handle the namespaces in the entity properly.
Solution:
Instead of using the lxml transform method just shell out to the standard xsl engine that the rest of the program uses, i.e. something along the lines of https://github.com/sbsdev/daisyproducer/blob/master/daisyproducer/documents/external.py#L132: