Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Maya Programming with Python Cookbook

You're reading from  Maya Programming with Python Cookbook

Product type Book
Published in Jul 2016
Publisher Packt
ISBN-13 9781785283987
Pages 266 pages
Edition 1st Edition
Languages
Author (1):
Adrian Herbez Adrian Herbez
Profile icon Adrian Herbez

Table of Contents (17) Chapters

Maya Programming with Python Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Getting Started with Maya 2. Creating User Interfaces 3. Working with Geometry 4. Giving Things a Coat of Paint – UVs and Materials 5. Adding Controls – Scripting for Rigging 6. Making Things Move – Scripting for Animation 7. Scripting for Rendering 8. Working with File Input/Output 9. Communicating with the Web 10. Advanced Topics Index

Working with XML data


When grabbing data from a web server, it's highly likely that you'll receive it in a structured format of one kind or another, with XML and JSON being the most common options. In this example, we'll look at how to make use of data served up as XML.

Getting ready

To use this example, you'll need to have an XML file available on a server somewhere. The easiest way to do this is to create a file locally on your machine, then run the following:

python -m SimpleHTTPServer

From the same directory as the file, provide access to it via localhost. Here's the file that I'll be using as the example:

<xml version="1.0">
    <object type="cube">
        <x>0</x>
        <y>2</y>
        <z>3</z>
        <size>3</size>
    </object>

    <object type="sphere">
        <size>2</size>
        <x>0</x>
        <y>0</y>
        <z>0</z>
    </object>
</xml>

The...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}