Avatar billede den-evil Nybegynder
04. december 2007 - 10:24 Der er 7 kommentarer

Hvordan får jeg fat i dette XML?

Som spørgsmålet lyder, så skal jeg have fat i noget XML...

Bær over med mig, der er meget XML....

Har noget XML der ser sådan ud:

- <Page ElementId="92" TypeId="1031" RightToLeft="False" CodePage="utf-8" ContentType="text/xml">
- <Editions>
- <Edition EditionId="1">
  <Label>Dansk</Label>
  <Name>Dansk</Name>
  </Edition>
- <Edition EditionId="2">
  <Label>Engelsk</Label>
  <Name>Engelsk</Name>
  </Edition>
  </Editions>
  <Name>Flash</Name>
- <Created>
- <Date UtcYear="2007" UtcMonth="11" UtcDay="30" UtcHour="8" UtcMinute="26" UtcSecond="0" UtcMillisecond="303" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>fredag</Day>
  <AbbreviatedDay>fr</AbbreviatedDay>
  <Month>november</Month>
  <AbbreviatedMonth>nov</AbbreviatedMonth>
  <XmlDate>2007-11-30T08:26:00.303Z</XmlDate>
  <LongDate>30. november 2007</LongDate>
  <ShortDate>30-11-2007</ShortDate>
  <ShortTime>09:26</ShortTime>
  <LongTime>09:26:00</LongTime>
  <LongDateLongTime>30. november 2007 09:26:00</LongDateLongTime>
  <ShortDateLongTime>30-11-2007 09:26:00</ShortDateLongTime>
  <ShortDateShortTime>30-11-2007 09:26</ShortDateShortTime>
  </Date>
  </Created>
- <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
- <Published>
- <Date UtcYear="2007" UtcMonth="11" UtcDay="30" UtcHour="8" UtcMinute="26" UtcSecond="0" UtcMillisecond="303" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>fredag</Day>
  <AbbreviatedDay>fr</AbbreviatedDay>
  <Month>november</Month>
  <AbbreviatedMonth>nov</AbbreviatedMonth>
  <XmlDate>2007-11-30T08:26:00.303Z</XmlDate>
  <LongDate>30. november 2007</LongDate>
  <ShortDate>30-11-2007</ShortDate>
  <ShortTime>09:26</ShortTime>
  <LongTime>09:26:00</LongTime>
  <LongDateLongTime>30. november 2007 09:26:00</LongDateLongTime>
  <ShortDateLongTime>30-11-2007 09:26:00</ShortDateLongTime>
  <ShortDateShortTime>30-11-2007 09:26</ShortDateShortTime>
  </Date>
  </Published>
- <PageEdition EditionId="1" Edition="Dansk">
+ <Editions>
  <Edition EditionId="1" />
  </Editions>
- <TemplateEditions>
  <Edition EditionId="1" />
  </TemplateEditions>
- <Metadata>
  <ContentMetadata />
  </Metadata>
- <Created>
- <Date UtcYear="2007" UtcMonth="11" UtcDay="30" UtcHour="8" UtcMinute="26" UtcSecond="0" UtcMillisecond="350" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>fredag</Day>
  <AbbreviatedDay>fr</AbbreviatedDay>
  <Month>november</Month>
  <AbbreviatedMonth>nov</AbbreviatedMonth>
  <XmlDate>2007-11-30T08:26:00.350Z</XmlDate>
  <LongDate>30. november 2007</LongDate>
  <ShortDate>30-11-2007</ShortDate>
  <ShortTime>09:26</ShortTime>
  <LongTime>09:26:00</LongTime>
  <LongDateLongTime>30. november 2007 09:26:00</LongDateLongTime>
  <ShortDateLongTime>30-11-2007 09:26:00</ShortDateLongTime>
  <ShortDateShortTime>30-11-2007 09:26</ShortDateShortTime>
  </Date>
  </Created>
- <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
- <LastEdited>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="55" UtcSecond="4" UtcMillisecond="250" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:55:04.250Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:55</ShortTime>
  <LongTime>09:55:04</LongTime>
  <LongDateLongTime>3. december 2007 09:55:04</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:55:04</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:55</ShortDateShortTime>
  </Date>
  </LastEdited>
- <LastEditedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </LastEditedBy>
  <Title>Flash</Title>
  <NavigationTitle>Flash</NavigationTitle>
  <Parameters />
  </PageEdition>
- <Layout>
- <Row Placement="1">
- <Cell Document="true" Functions="true" SimpleContent="true" ModuleElements="true" Id="1" Placement="1" TemplateContentOnly="false">
  <Title>Content area</Title>
- <ContentArea>
- <Module ElementId="10" TypeId="200047">
+ <Editions>
- <Edition EditionId="1">
  <Label>Dansk</Label>
  <Name>Dansk</Name>
  </Edition>
- <Edition EditionId="2">
  <Label>Engelsk</Label>
  <Name>Engelsk</Name>
  </Edition>
  </Editions>
  <Name>Forside Flash Document List</Name>
+ <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="52" UtcSecond="2" UtcMillisecond="810" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:52:02.810Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:52</ShortTime>
  <LongTime>09:52:02</LongTime>
  <LongDateLongTime>3. december 2007 09:52:02</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:52:02</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:52</ShortDateShortTime>
  </Date>
  </Created>
+ <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
+ <ModuleEdition EditionId="1" Edition="Dansk">
- <Editions>
  <Edition EditionId="1" />
  </Editions>
  <TemplateEditions />
- <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="52" UtcSecond="2" UtcMillisecond="903" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:52:02.903Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:52</ShortTime>
  <LongTime>09:52:02</LongTime>
  <LongDateLongTime>3. december 2007 09:52:02</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:52:02</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:52</ShortDateShortTime>
  </Date>
  </Created>
- <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
- <LastEdited>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="55" UtcSecond="4" UtcMillisecond="250" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:55:04.250Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:55</ShortTime>
  <LongTime>09:55:04</LongTime>
  <LongDateLongTime>3. december 2007 09:55:04</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:55:04</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:55</ShortDateShortTime>
  </Date>
  </LastEdited>
- <LastEditedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </LastEditedBy>
  </ModuleEdition>
- <Layout>
- <Row Placement="1">
- <Cell Document="true" Functions="false" SimpleContent="true" ModuleElements="false" Id="1" Placement="1" TemplateContentOnly="true">
  <Title>Template content</Title>
  <ContentArea />
  </Cell>
- <Cell Document="true" Functions="false" SimpleContent="true" ModuleElements="true" Id="2" Placement="2" TemplateContentOnly="false">
  <Title>Module content</Title>
- <ContentArea>
- <ModuleElement>
- <Documents>
- <Document Id="47">
  <Name>default</Name>
- <DocumentEdition>
- <Fields>
  <Field Name="Heading" FieldType="SingleLineText">Plads til rummelighed</Field>
  <Field Name="Id" FieldType="SingleLineText">0</Field>
+ <Field Name="Link" FieldType="Link">
+ <Link LinkType="3" OpenInNewWindow="false" LinkId="115" Broken="true">
  <Destination TypeId="-1" ElementId="-1" />
  <AnchorLink TypeId="-1" ElementId="-1" />
  <Edition Id="-1" />
  <Channel Id="-1" />
  <Url />
  <LinkText />
  <LinkTitle />
  </Link>
  <Output><Link LinkType="3" OpenInNewWindow="false" LinkId="115" Broken="true"><Destination TypeId="-1" ElementId="-1" /><AnchorLink TypeId="-1" ElementId="-1" /><Edition Id="-1" /><Channel Id="-1" /><Url /><LinkText /><LinkTitle /></Link></Output>
  </Field>
- <Field Name="Media" FieldType="Media">
- <FileConfiguration ElementId="51" TypeId="1024">
+ <Editions>
- <Edition EditionId="1">
  <Label>Dansk</Label>
  <Name>Dansk</Name>
  </Edition>
- <Edition EditionId="2">
  <Label>Engelsk</Label>
  <Name>Engelsk</Name>
  </Edition>
  </Editions>
  <Name>Media</Name>
+ <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="50" UtcSecond="15" UtcMillisecond="107" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:50:15.107Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:50</ShortTime>
  <LongTime>09:50:15</LongTime>
  <LongDateLongTime>3. december 2007 09:50:15</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:50:15</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:50</ShortDateShortTime>
  </Date>
  </Created>
+ <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
+ <FileConfigurationEdition EditionId="1" Edition="Dansk">
- <Editions>
  <Edition EditionId="1" />
  </Editions>
- <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="50" UtcSecond="15" UtcMillisecond="107" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:50:15.107Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:50</ShortTime>
  <LongTime>09:50:15</LongTime>
  <LongDateLongTime>3. december 2007 09:50:15</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:50:15</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:50</ShortDateShortTime>
  </Date>
  </Created>
- <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
- <LastEdited>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="50" UtcSecond="16" UtcMillisecond="250" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:50:16.250Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:50</ShortTime>
  <LongTime>09:50:16</LongTime>
  <LongDateLongTime>3. december 2007 09:50:16</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:50:16</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:50</ShortDateShortTime>
  </Date>
  </LastEdited>
- <LastEditedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </LastEditedBy>
  </FileConfigurationEdition>
  </FileConfiguration>
  </Field>
  <Field Name="Text" FieldType="TextArea">dsfio iof jhfdsjkf k sdjk f fjklsd fkljsd jkd gfg df g fsdg fdg fdg fd f g sdfg fsdg fdg fgdg</Field>
  </Fields>
  </DocumentEdition>
  </Document>
- <Document Id="48">
  <Name>jobcentre</Name>
- <DocumentEdition>
- <Fields>
  <Field Name="Heading" FieldType="SingleLineText">Jobcentre har plads til rummelighed</Field>
  <Field Name="Id" FieldType="SingleLineText">1</Field>
- <Field Name="Link" FieldType="Link">
- <Link LinkType="2" OpenInNewWindow="false" LinkId="116" Broken="false">
  <Destination TypeId="1031" ElementId="3" />
  <AnchorLink TypeId="-1" ElementId="-1" />
  <Edition Id="-1" />
  <Channel Id="-1" />
  <Url>via3.html</Url>
  <LinkText />
  <LinkTitle />
  </Link>
  <Output><Link LinkType="2" OpenInNewWindow="false" LinkId="116" Broken="false"><Destination TypeId="1031" ElementId="3" /><AnchorLink TypeId="-1" ElementId="-1" /><Edition Id="-1" /><Channel Id="-1" /><Url>via3.html</Url><LinkText /><LinkTitle /></Link></Output>
  </Field>
- <Field Name="Media" FieldType="Media">
- <FileConfiguration ElementId="52" TypeId="1024">
- <Editions>
- <Edition EditionId="1">
  <Label>Dansk</Label>
  <Name>Dansk</Name>
  </Edition>
- <Edition EditionId="2">
  <Label>Engelsk</Label>
  <Name>Engelsk</Name>
  </Edition>
  </Editions>
  <Name>Media</Name>
- <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="56" UtcSecond="19" UtcMillisecond="13" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:56:19.013Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:56</ShortTime>
  <LongTime>09:56:19</LongTime>
  <LongDateLongTime>3. december 2007 09:56:19</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:56:19</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:56</ShortDateShortTime>
  </Date>
  </Created>
- <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
- <FileConfigurationEdition EditionId="1" Edition="Dansk">
- <Editions>
  <Edition EditionId="1" />
  </Editions>
- <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="56" UtcSecond="19" UtcMillisecond="13" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:56:19.013Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:56</ShortTime>
  <LongTime>09:56:19</LongTime>
  <LongDateLongTime>3. december 2007 09:56:19</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:56:19</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:56</ShortDateShortTime>
  </Date>
  </Created>
- <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
- <LastEdited>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="56" UtcSecond="19" UtcMillisecond="357" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:56:19.357Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:56</ShortTime>
  <LongTime>09:56:19</LongTime>
  <LongDateLongTime>3. december 2007 09:56:19</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:56:19</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:56</ShortDateShortTime>
  </Date>
  </LastEdited>
- <LastEditedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </LastEditedBy>
  </FileConfigurationEdition>
  </FileConfiguration>
  </Field>
  <Field Name="Text" FieldType="TextArea">fgh dgh fg h fgh gfh gfh g gd gd lkg, hdj hgl jhg hklgjgf gf gh jhj hj gh jhgj hgj hj hgj h j hj h jhf jf</Field>
  </Fields>
  </DocumentEdition>
  </Document>

--------------------------
Der er faktisk mere, men det er irrelevant lige nu....

Anyway, det jeg skal ind i er Document, derefter skal jeg have fat i Heading, URL og Text...

Jeg prøver at gøre sådan her, men kan ikke få det til at makke ret:

function loadXML(loaded) {
    //Hvis XML er Loaded/Hentet
    if (loaded) {
        xmlNode = this.firstChild;
        xmlNode2 = this.firstChild.childNodes[5].childNodes[1].childNodes[0];
        trace(xmlNode2);
        //trace(xmlNode);
        heading = [];
        url = [];
        maintext = [];
        _root.total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            //trace(heading[i] = xmlNode.childNodes[i].childNodes[0].childNodes[0].firstChild.nodeValue;
            trace(heading[i] = xmlNode.childNodes[i].chileNodes[0].chileNodes[3].firstChild.attributes.name);
            heading[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
            url[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
            maintext[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
        }
    } else {
        content = "file not loaded!";
    }
}
Avatar billede den-evil Nybegynder
04. december 2007 - 10:27 #1
Faktisk skal jeg ind i denne:

- <Document Id="47">
  <Name>default</Name>
- <DocumentEdition>
- <Fields>
  <Field Name="Heading" FieldType="SingleLineText">Plads til rummelighed</Field>
  <Field Name="Id" FieldType="SingleLineText">0</Field>
+ <Field Name="Link" FieldType="Link">
+ <Link LinkType="3" OpenInNewWindow="false" LinkId="115" Broken="true">
  <Destination TypeId="-1" ElementId="-1" />
  <AnchorLink TypeId="-1" ElementId="-1" />
  <Edition Id="-1" />
  <Channel Id="-1" />
  <Url />
  <LinkText />
  <LinkTitle />
  </Link>
  <Output><Link LinkType="3" OpenInNewWindow="false" LinkId="115" Broken="true"><Destination TypeId="-1" ElementId="-1" /><AnchorLink TypeId="-1" ElementId="-1" /><Edition Id="-1" /><Channel Id="-1" /><Url /><LinkText /><LinkTitle /></Link></Output>
  </Field>
- <Field Name="Media" FieldType="Media">
- <FileConfiguration ElementId="51" TypeId="1024">
+ <Editions>
- <Edition EditionId="1">
  <Label>Dansk</Label>
  <Name>Dansk</Name>
  </Edition>
- <Edition EditionId="2">
  <Label>Engelsk</Label>
  <Name>Engelsk</Name>
  </Edition>
  </Editions>
  <Name>Media</Name>
+ <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="50" UtcSecond="15" UtcMillisecond="107" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:50:15.107Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:50</ShortTime>
  <LongTime>09:50:15</LongTime>
  <LongDateLongTime>3. december 2007 09:50:15</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:50:15</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:50</ShortDateShortTime>
  </Date>
  </Created>
+ <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
+ <FileConfigurationEdition EditionId="1" Edition="Dansk">
- <Editions>
  <Edition EditionId="1" />
  </Editions>
- <Created>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="50" UtcSecond="15" UtcMillisecond="107" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:50:15.107Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:50</ShortTime>
  <LongTime>09:50:15</LongTime>
  <LongDateLongTime>3. december 2007 09:50:15</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:50:15</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:50</ShortDateShortTime>
  </Date>
  </Created>
- <CreatedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </CreatedBy>
- <LastEdited>
- <Date UtcYear="2007" UtcMonth="12" UtcDay="3" UtcHour="8" UtcMinute="50" UtcSecond="16" UtcMillisecond="250" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
  <Day>mandag</Day>
  <AbbreviatedDay>ma</AbbreviatedDay>
  <Month>december</Month>
  <AbbreviatedMonth>dec</AbbreviatedMonth>
  <XmlDate>2007-12-03T08:50:16.250Z</XmlDate>
  <LongDate>3. december 2007</LongDate>
  <ShortDate>03-12-2007</ShortDate>
  <ShortTime>09:50</ShortTime>
  <LongTime>09:50:16</LongTime>
  <LongDateLongTime>3. december 2007 09:50:16</LongDateLongTime>
  <ShortDateLongTime>03-12-2007 09:50:16</ShortDateLongTime>
  <ShortDateShortTime>03-12-2007 09:50</ShortDateShortTime>
  </Date>
  </LastEdited>
- <LastEditedBy>
  <UserName>Johannes Findorf</UserName>
- <Properties>
  <Property Name="FirstName" />
  <Property Name="LastName" />
  <Property Name="Initials" />
  <Property Name="PrettyName" />
  <Property Name="Email">jof@dynamicweb.dk</Property>
  </Properties>
  </LastEditedBy>
  </FileConfigurationEdition>
  </FileConfiguration>
  </Field>
  <Field Name="Text" FieldType="TextArea">dsfio iof jhfdsjkf k sdjk f fjklsd fkljsd jkd gfg df g fsdg fdg fdg fd f g sdfg fsdg fdg fgdg</Field>
  </Fields>
  </DocumentEdition>
  </Document>


Det er der de ting jeg skal bruge er....
Avatar billede barklund Nybegynder
04. december 2007 - 10:50 #2
XPath er din ven:

http://www.xfactorstudio.com/

Det er sourcecode samt guides til, hvordan du bruger det :)
Avatar billede den-evil Nybegynder
04. december 2007 - 11:02 #3
Jep jep, men det er nu i flash jeg skal hente det ind jo...

her er min kode so far:

//Hent XML

function loadXML(loaded) {
    //Hvis XML er Loaded/Hentet
    if (loaded) {
        xmlNode = this.firstChild;
        //heading = this.firstChild.childNodes[6].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].firstChild.nodeValue;
        //url = this.firstChild.childNodes[6].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[2].childNodes[0].childNodes[4].firstChild.nodeValue;
        //maintext = this.firstChild.childNodes[6].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[4].childNodes[0].firstChild.nodeValue;
        //trace(maintext);
        //trace(xmlNode);
        heading = [];
        url = [];
        maintext = [];
        _root.total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            //trace(heading[i] = xmlNode.childNodes[i].childNodes[0].childNodes[0].firstChild.nodeValue;
            trace(heading[i] = xmlNode.childNodes[i].chileNodes[0].chileNodes[3].firstChild.attributes.name);
           
            heading[i] = this.firstChild.childNodes[6].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].firstChild.nodeValue;
            url[i] = this.firstChild.childNodes[6].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[2].childNodes[0].childNodes[4].firstChild.nodeValue;
            maintext[i] = this.firstChild.childNodes[6].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[4].childNodes[0].firstChild.nodeValue;

            //trace(heading[i]);
            //trace(url[i]);
            //trace[maintext[i]);
           
            //heading[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
            //url[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
            //maintext[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
       
        }
    } else {
        content = "file not loaded!";
    }
}

xmlCabiData = new XML();
xmlCabiData.ignoreWhite = true;
xmlCabiData.onLoad = loadXML;

xmlCabiData.load("http://xxx/Forside/Flash?xml="+id);
Avatar billede barklund Nybegynder
04. december 2007 - 11:09 #4
Hm, i hvilket program mon man kan bruge en implementation af XPath, der hedder "XPath for Actionscript"? ;)

Brug xpath og du slipper for at skrive child nogen sinde igen :)
Avatar billede den-evil Nybegynder
04. december 2007 - 13:10 #5
Ok, jamen så lad mig da lige høre hvordan jeg gør sådan så? :D
Avatar billede den-evil Nybegynder
04. december 2007 - 13:52 #6
Jeg fandt ud af det med de childnodes :) Kode:
_root.p = 0;
//Hent XML

function loadXML(loaded) {
    //Hvis XML er Loaded/Hentet
    if (loaded) {
        xmlNode = this.firstChild.childNodes[6].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[0].childNodes[0];
        //heading = xmlNode.childNodes[0].childNodes[1].childNodes[0].childNodes[0].firstChild.nodeValue;
        //url = xmlNode.childNodes[0].childNodes[1].childNodes[0].childNodes[2].childNodes[0].childNodes[4].firstChild.nodeValue;
          maintext = xmlNode.childNodes[0].childNodes[1].childNodes[0].childNodes[4].childNodes[0];
        //trace(maintext);
        //trace(xmlNode);
        heading = [];
        url = [];
        maintext = [];
       
        _root.total = xmlNode.childNodes.length;
        trace(_root.total = xmlNode.childNodes.length);
        for (i=0; i<total; i++) {
            //trace(heading[i] = xmlNode.childNodes[i].childNodes[0].childNodes[0].firstChild.nodeValue;
            //trace(heading[i] = xmlNode.childNodes[i].chileNodes[0].chileNodes[3].firstChild.attributes.name);
            //trace(i);
           
            heading[i] = xmlNode.childNodes[i].childNodes[1].childNodes[0].childNodes[0].firstChild.nodeValue;
            url[i] = xmlNode.childNodes[i].childNodes[1].childNodes[0].childNodes[2].childNodes[0].childNodes[4].firstChild.nodeValue;
            maintext[i] = xmlNode.childNodes[i].childNodes[1].childNodes[0].childNodes[4].childNodes[0];
           
            //trace(xmlNode.childNodes[i].childNodes[1].childNodes[0].childNodes[0].firstChild.nodeValue);
            //trace(xmlNode.childNodes[i].childNodes[1].childNodes[0].childNodes[4].childNodes[0]);
           
            //trace(heading[1]);
            //trace(url);
            //trace[maintext);
           
            //heading[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
            //url[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
            //maintext[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
            //TextUpdate(i);
        }
       
    } else {
        content = "file not loaded!";
    }
}

xmlCabiData = new XML();
xmlCabiData.ignoreWhite = true;
xmlCabiData.onLoad = loadXML;

//http://cabidev2.synkronvia.com/Forside/Flash?xml=1
//xmlCabiData.load("XMLFILE.xml");

xmlCabiData.load("http://cabidev2.synkronvia.com/Forside/Flash?xml="+id);

function TextUpdate(p){

        if (loaded == filesize) {
            maintext = maintext[p];
            heading = heading[p];
        }
}
Avatar billede barklund Nybegynder
04. december 2007 - 14:28 #7
Jeg var blevet sindsyg, hvis jeg skulle skrive så meget childNodes! XPath kunne gøre det for dig på et par linjer - og havde du klikket på linket ovenover ville du nok kunne gætte dig til, hvordan det skulle bruges :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester