Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

You might want to rethink your approach in a fundamental way if you want to create millions of rows of XML.

Once you have this infrastructure of Python classes that produce XML in place, then you do the following.

  • Rewrite your XSD parser so that it creates your Plain Old Python Object class definitions from the XSD. It's an XSD->Python translator.

Now you do the bulk of your work in Python. Millions of rows in simple Python class definitions is easy. XML is merely serialized Python objects. Since the XSD is not used, this, too, is easy.

Further (and most importantly) you do a one-time-only conversion of XSD to Python.

Look at this Stackoverflow question for a direction to take. http://stackoverflow.com/questions/1072853/convert-xsd-to-python-class https://stackoverflow.com/questions/1072853/convert-xsd-to-python-class

You might want to rethink your approach in a fundamental way if you want to create millions of rows of XML.

  • Define Python classes to contain your actual data. These must be absolutely correct, based on ordinary Python processing. No XSD-based lookup or validation or range checking or anything. Just Python. Your application data must be in Plain Old Python Objects (POPO).

  • Write a "serializer" that creates XML from your Plain Old Python Objects. Since the Python objects are already absolutely correct, the output XML will be absolutely correct.

    Or locate a seraializer. http://coder.cl/products/pyxser/ Django has one.

    http://stackoverflow.com/questions/1500575/python-xml-serializers

Once you have this infrastructure of Python classes that produce XML in place, then you do the following.

  • Rewrite your XSD parser so that it creates your Plain Old Python Object class definitions from the XSD. It's an XSD->Python translator.

Now you do the bulk of your work in Python. Millions of rows in simple Python class definitions is easy. XML is merely serialized Python objects. Since the XSD is not used, this, too, is easy.

Further (and most importantly) you do a one-time-only conversion of XSD to Python.

Look at this Stackoverflow question for a direction to take. http://stackoverflow.com/questions/1072853/convert-xsd-to-python-class

You might want to rethink your approach in a fundamental way if you want to create millions of rows of XML.

  • Define Python classes to contain your actual data. These must be absolutely correct, based on ordinary Python processing. No XSD-based lookup or validation or range checking or anything. Just Python. Your application data must be in Plain Old Python Objects (POPO).

  • Write a "serializer" that creates XML from your Plain Old Python Objects. Since the Python objects are already absolutely correct, the output XML will be absolutely correct.

    Or locate a seraializer. http://coder.cl/products/pyxser/ Django has one.

    https://stackoverflow.com/questions/1500575/python-xml-serializers

Once you have this infrastructure of Python classes that produce XML in place, then you do the following.

  • Rewrite your XSD parser so that it creates your Plain Old Python Object class definitions from the XSD. It's an XSD->Python translator.

Now you do the bulk of your work in Python. Millions of rows in simple Python class definitions is easy. XML is merely serialized Python objects. Since the XSD is not used, this, too, is easy.

Further (and most importantly) you do a one-time-only conversion of XSD to Python.

Look at this Stackoverflow question for a direction to take. https://stackoverflow.com/questions/1072853/convert-xsd-to-python-class

added 154 characters in body
Source Link
S.Lott
  • 780
  • 3
  • 6

You might want to rethink your approach in a fundamental way if you want to create millions of rows of XML.

  • Define Python classes to contain your actual data. These must be absolutely correct, based on ordinary Python processing. No XSD-based lookup or validation or range checking or anything. Just Python. Your application data must be in Plain Old Python Objects (POPO).

  • Write a "serializer" that creates XML from your Plain Old Python Objects. Since the Python objects are already absolutely correct, the output XML will be absolutely correct.

    Or locate a seraializer. http://coder.cl/products/pyxser/ Django has one.

    http://stackoverflow.com/questions/1500575/python-xml-serializers

Once you have this infrastructure of Python classes that produce XML in place, then you do the following.

  • Rewrite your XSD parser so that it creates your Plain Old Python Object class definitions from the XSD. It's an XSD->Python translator.

Now you do the bulk of your work in Python. Millions of rows in simple Python class definitions is easy. XML is merely serialized Python objects. Since the XSD is not used, this, too, is easy.

Further (and most importantly) you do a one-time-only conversion of XSD to Python.

Look at this Stackoverflow question for a direction to take. http://stackoverflow.com/questions/1072853/convert-xsd-to-python-class

You might want to rethink your approach in a fundamental way if you want to create millions of rows of XML.

  • Define Python classes to contain your actual data. These must be absolutely correct, based on ordinary Python processing. No XSD-based lookup or validation or range checking or anything. Just Python. Your application data must be in Plain Old Python Objects (POPO).

  • Write a "serializer" that creates XML from your Plain Old Python Objects. Since the Python objects are already absolutely correct, the output XML will be absolutely correct.

Once you have this infrastructure of Python classes that produce XML in place, then you do the following.

  • Rewrite your XSD parser so that it creates your Plain Old Python Object class definitions from the XSD. It's an XSD->Python translator.

Now you do the bulk of your work in Python. Millions of rows in simple Python class definitions is easy. XML is merely serialized Python objects. Since the XSD is not used, this, too, is easy.

Further (and most importantly) you do a one-time-only conversion of XSD to Python.

Look at this Stackoverflow question for a direction to take. http://stackoverflow.com/questions/1072853/convert-xsd-to-python-class

You might want to rethink your approach in a fundamental way if you want to create millions of rows of XML.

  • Define Python classes to contain your actual data. These must be absolutely correct, based on ordinary Python processing. No XSD-based lookup or validation or range checking or anything. Just Python. Your application data must be in Plain Old Python Objects (POPO).

  • Write a "serializer" that creates XML from your Plain Old Python Objects. Since the Python objects are already absolutely correct, the output XML will be absolutely correct.

    Or locate a seraializer. http://coder.cl/products/pyxser/ Django has one.

    http://stackoverflow.com/questions/1500575/python-xml-serializers

Once you have this infrastructure of Python classes that produce XML in place, then you do the following.

  • Rewrite your XSD parser so that it creates your Plain Old Python Object class definitions from the XSD. It's an XSD->Python translator.

Now you do the bulk of your work in Python. Millions of rows in simple Python class definitions is easy. XML is merely serialized Python objects. Since the XSD is not used, this, too, is easy.

Further (and most importantly) you do a one-time-only conversion of XSD to Python.

Look at this Stackoverflow question for a direction to take. http://stackoverflow.com/questions/1072853/convert-xsd-to-python-class

Source Link
S.Lott
  • 780
  • 3
  • 6

You might want to rethink your approach in a fundamental way if you want to create millions of rows of XML.

  • Define Python classes to contain your actual data. These must be absolutely correct, based on ordinary Python processing. No XSD-based lookup or validation or range checking or anything. Just Python. Your application data must be in Plain Old Python Objects (POPO).

  • Write a "serializer" that creates XML from your Plain Old Python Objects. Since the Python objects are already absolutely correct, the output XML will be absolutely correct.

Once you have this infrastructure of Python classes that produce XML in place, then you do the following.

  • Rewrite your XSD parser so that it creates your Plain Old Python Object class definitions from the XSD. It's an XSD->Python translator.

Now you do the bulk of your work in Python. Millions of rows in simple Python class definitions is easy. XML is merely serialized Python objects. Since the XSD is not used, this, too, is easy.

Further (and most importantly) you do a one-time-only conversion of XSD to Python.

Look at this Stackoverflow question for a direction to take. http://stackoverflow.com/questions/1072853/convert-xsd-to-python-class

default

AltStyle によって変換されたページ (->オリジナル) /