www.webdeveloper.com
Results 1 to 7 of 7

Thread: Break Up / Split XML

  1. #1
    Join Date
    May 2011
    Posts
    6

    Break Up / Split XML

    Hi All,

    I have a flash guage which gets its values from a XML file, the value shown on the guage is constantly changing so i need to map an excel worksheet to the XML. Trouble is i need to split the XML up: see below:

    Complete XML File:
    <?xml version="1.0" encoding="utf-8"?>
    <Chart type="gauges" subtype="dial">
    <visual>
    <chartbackground type="plain" color="0xffffff" opacity="25"/>
    <gauge xoffset="0" yoffset="0" radius="0" colors="0xffffff,0x000000" opacities="100,100"
    dropshadow="false"/>
    <dial colors="0x003366,0x333333" opacities="100,100" needlestyle="plastic" />
    <chartzones lengths="5,3,2" colors="0x66ff33,0xffcc00,0xff0000" opacities="50,20,10"/>
    <charttitle visible="true" text="Amps"
    font="Arial" bold="True" italic="false" underline="false" kerning="false" size="20"
    color="0x999999" align="center"/>
    <chartsubtitle visible="true" text="Aurora Stadium\nSite Amperage"
    font="Arial" bold="True" italic="false" underline="false" kerning="false" size="12"
    color="0x6699CC" align="center"/>
    <xaxisticklabel font="Calibri" bold="True" italic="false" underline="false" kerning="false" size="12"
    color="0xcccccc"/>
    </visual>
    <datatable comment="Min, Max, Current Value and the Title is all needed">
    <row>
    <col alt="reserved"/>
    <col alt="min">0</col>
    <col alt="max">20</col>
    <col alt="value">33</col>
    </row>

    </datatable>
    </chart>

    I want to create a new XML file with the RED text only in it and link to this file?

    Can anyone help?

    Thanks

    Nick

  2. #2
    Join Date
    May 2011
    Posts
    6
    Has anybody any advice, i am really needing some help?

  3. #3
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Assume that you row is saved in a file "row.xml", then:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE chart [
    	<!ENTITY row SYSTEM "row.xml">
    ]>
    <chart type="gauges" subtype="dial">
    	<visual>
    		<chartbackground type="plain" color="0xffffff" opacity="25"/>
    		<gauge xoffset="0" yoffset="0" radius="0" colors="0xffffff,0x000000" opacities="100,100" dropshadow="false"/>
    		<dial colors="0x003366,0x333333" opacities="100,100" needlestyle="plastic" />
    		<chartzones lengths="5,3,2" colors="0x66ff33,0xffcc00,0xff0000" opacities="50,20,10"/>
    		<charttitle visible="true" text="Amps" font="Arial" bold="True" italic="false" underline="false" kerning="false" size="20" color="0x999999" align="center"/>
    		<chartsubtitle visible="true" text="Aurora Stadium\nSite Amperage" font="Arial" bold="True" italic="false" underline="false" kerning="false" size="12" color="0x6699CC" align="center"/>
    		<xaxisticklabel font="Calibri" bold="True" italic="false" underline="false" kerning="false" size="12" color="0xcccccc"/>
    	</visual>
    	<datatable comment="Min, Max, Current Value and the Title is all needed">
    	&row;
    	</datatable>
    </chart>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  4. #4
    Join Date
    May 2011
    Posts
    6
    Quote Originally Posted by Charles View Post
    Assume that you row is saved in a file "row.xml", then:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE chart [
    	<!ENTITY row SYSTEM "row.xml">
    ]>
    <chart type="gauges" subtype="dial">
    	<visual>
    		<chartbackground type="plain" color="0xffffff" opacity="25"/>
    		<gauge xoffset="0" yoffset="0" radius="0" colors="0xffffff,0x000000" opacities="100,100" dropshadow="false"/>
    		<dial colors="0x003366,0x333333" opacities="100,100" needlestyle="plastic" />
    		<chartzones lengths="5,3,2" colors="0x66ff33,0xffcc00,0xff0000" opacities="50,20,10"/>
    		<charttitle visible="true" text="Amps" font="Arial" bold="True" italic="false" underline="false" kerning="false" size="20" color="0x999999" align="center"/>
    		<chartsubtitle visible="true" text="Aurora Stadium\nSite Amperage" font="Arial" bold="True" italic="false" underline="false" kerning="false" size="12" color="0x6699CC" align="center"/>
    		<xaxisticklabel font="Calibri" bold="True" italic="false" underline="false" kerning="false" size="12" color="0xcccccc"/>
    	</visual>
    	<datatable comment="Min, Max, Current Value and the Title is all needed">
    	&row;
    	</datatable>
    </chart>


    Thanks for your help. I tried this but it doesn't seem to work.

    I changed the guagesample.xml as you showed above, then added the following to a new xml file called row.xml.


    <row>
    <col alt="reserved"/>
    <col alt="min">0</col>
    <col alt="max">10</col>
    <col alt="value">7.23</col>
    </row>


    The Flash guage doesn't even show up?

    Thanks

    Nick

  5. #5
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    But it does work, however, in any proper user agent that implements the XML specs. MSIE even gets it right. View the thing in MSIE to make sure that it you really are doing it right. If it still doesn't work then that's just one more reason to eschew icky flash.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  6. #6
    Join Date
    May 2011
    Posts
    6
    Quote Originally Posted by Charles View Post
    But it does work, however, in any proper user agent that implements the XML specs. MSIE even gets it right. View the thing in MSIE to make sure that it you really are doing it right. If it still doesn't work then that's just one more reason to eschew icky flash.
    Thanks for this i really appreciate it.

    I am already using MSIE to view this guage, it wont load in Firefox.

    I have attached the files all zipped up which doesn't work. The test.htm file is the file which displays the guage.

    Thanks again.

    Nick
    Attached Files Attached Files

  7. #7
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    I meant run the XML through MSIE as XML. That'll let you know if the XML part is right, which it is. Your problem is a flash problem, not an XML one. Though you might solve it by pre-processing the XML server side, it's best to just avoid icky flash.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles