Aide - Type de tout ce qu'il faut de travail...mais bon de ne pas:)
- playboxdesign
- Born


- Inscription: Juin 15, 2010
- Messages: 3
- Loc: UK
- Status: Offline
Ceci est mon code (il semble plutôt étrange, mais fonctionne en partie):
et mon XML:
Toute conseils sur ce que je peux faire pour ranger It Up s'il vous plaît????
Code: [ Select ]
UnitdataXML = new XML();
UnitdataXML.ignoreWhite = true;
UnitdataXML.onLoad = myLoad;
UnitdataXML.load("Moodle.xml");
function myLoad(ok) {
if (ok == true) {
Publish(this.firstChild);
}
}
function Publish(UnitdataXMLNode) {
if (UnitdataXMLNode.nodeName.toUpperCase() == "UNIT") {
content = "";
unit_info = UnitdataXMLNode.firstChild;
while (unit_info != null) {
if (unit_info.nodeName.toUpperCase() == "UNIT_INFO") {
uno = "";
uname = "";
loutcomes = "";
pass = "";
merit = "";
distinction = "";
}
element = unit_info.firstChild;
//////////////////////////////////////////////////////////////////////////
while (element != null) {
if (element.nodeName.toUpperCase() == "UNO") {
uno = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "UNAME") {
uname = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "LOUTCOMES") {
loutcomes = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "PASS") {
pass = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "MERIT") {
merit = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "DISTINCTION") {
distinction = element.firstChild.nodeValue;
}
element = element.nextSibling;
}
unit_info = unit_info.nextSibling;
//////////////////////////////////////////////////////////////////////
}
unitH_txt.htmlText = "<font size='18' color='#00CC00'>"+uno+"</font>";
unitT_txt.htmlText = "<font size='16'>"+uname+"</font>";
loutcomes = UnitdataXMLNode.firstChild.childNodes[2].childNodes;
//trace(loutcomes.length)
for (i=0; i<loutcomes.length; i++) {
var num = i+1;
var info = UnitdataXMLNode.firstChild.childNodes[2].childNodes[i].firstChild.nodeValue;
Mix += "<LI>"+info+"</LI>";
//trace("LO"+num+" = "+info+".");
}
pass = UnitdataXMLNode.firstChild.childNodes[3].childNodes;
//trace (pass.length);
for (j=0; j<pass.length; j++) {
var num = j+1;
var info2 = UnitdataXMLNode.firstChild.childNodes[3].childNodes[j].firstChild.nodeValue;
passInfo += "<LI>"+info2+"</LI>";
//trace ("P"+num+" = "+info2+".")
}
merit = UnitdataXMLNode.firstChild.childNodes[4].childNodes;
for (k=0; k<merit.length; k++) {
var num = k+1;
var info3 = UnitdataXMLNode.firstChild.childNodes[4].childNodes[k].firstChild.nodeValue;
meritInfo += "<LI>"+info3+"</LI>";
}
dist = UnitdataXMLNode.firstChild.childNodes[5].childNodes;
for (l=0; l<dist.length; l++) {
var num = l+1;
var info4 = UnitdataXMLNode.firstChild.childNodes[5].childNodes[l].firstChild.nodeValue;
distInfo += "<LI>"+info4+"</LI>";
}
LO = "<font size='12'><UL>"+Mix+"</UL></font>";
l1_txt.htmlText = LO;
}
}
UnitdataXML.ignoreWhite = true;
UnitdataXML.onLoad = myLoad;
UnitdataXML.load("Moodle.xml");
function myLoad(ok) {
if (ok == true) {
Publish(this.firstChild);
}
}
function Publish(UnitdataXMLNode) {
if (UnitdataXMLNode.nodeName.toUpperCase() == "UNIT") {
content = "";
unit_info = UnitdataXMLNode.firstChild;
while (unit_info != null) {
if (unit_info.nodeName.toUpperCase() == "UNIT_INFO") {
uno = "";
uname = "";
loutcomes = "";
pass = "";
merit = "";
distinction = "";
}
element = unit_info.firstChild;
//////////////////////////////////////////////////////////////////////////
while (element != null) {
if (element.nodeName.toUpperCase() == "UNO") {
uno = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "UNAME") {
uname = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "LOUTCOMES") {
loutcomes = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "PASS") {
pass = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "MERIT") {
merit = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == "DISTINCTION") {
distinction = element.firstChild.nodeValue;
}
element = element.nextSibling;
}
unit_info = unit_info.nextSibling;
//////////////////////////////////////////////////////////////////////
}
unitH_txt.htmlText = "<font size='18' color='#00CC00'>"+uno+"</font>";
unitT_txt.htmlText = "<font size='16'>"+uname+"</font>";
loutcomes = UnitdataXMLNode.firstChild.childNodes[2].childNodes;
//trace(loutcomes.length)
for (i=0; i<loutcomes.length; i++) {
var num = i+1;
var info = UnitdataXMLNode.firstChild.childNodes[2].childNodes[i].firstChild.nodeValue;
Mix += "<LI>"+info+"</LI>";
//trace("LO"+num+" = "+info+".");
}
pass = UnitdataXMLNode.firstChild.childNodes[3].childNodes;
//trace (pass.length);
for (j=0; j<pass.length; j++) {
var num = j+1;
var info2 = UnitdataXMLNode.firstChild.childNodes[3].childNodes[j].firstChild.nodeValue;
passInfo += "<LI>"+info2+"</LI>";
//trace ("P"+num+" = "+info2+".")
}
merit = UnitdataXMLNode.firstChild.childNodes[4].childNodes;
for (k=0; k<merit.length; k++) {
var num = k+1;
var info3 = UnitdataXMLNode.firstChild.childNodes[4].childNodes[k].firstChild.nodeValue;
meritInfo += "<LI>"+info3+"</LI>";
}
dist = UnitdataXMLNode.firstChild.childNodes[5].childNodes;
for (l=0; l<dist.length; l++) {
var num = l+1;
var info4 = UnitdataXMLNode.firstChild.childNodes[5].childNodes[l].firstChild.nodeValue;
distInfo += "<LI>"+info4+"</LI>";
}
LO = "<font size='12'><UL>"+Mix+"</UL></font>";
l1_txt.htmlText = LO;
}
}
- UnitdataXML = new XML();
- UnitdataXML.ignoreWhite = true;
- UnitdataXML.onLoad = myLoad;
- UnitdataXML.load("Moodle.xml");
- function myLoad(ok) {
- if (ok == true) {
- Publish(this.firstChild);
- }
- }
- function Publish(UnitdataXMLNode) {
- if (UnitdataXMLNode.nodeName.toUpperCase() == "UNIT") {
- content = "";
- unit_info = UnitdataXMLNode.firstChild;
- while (unit_info != null) {
- if (unit_info.nodeName.toUpperCase() == "UNIT_INFO") {
- uno = "";
- uname = "";
- loutcomes = "";
- pass = "";
- merit = "";
- distinction = "";
- }
- element = unit_info.firstChild;
- //////////////////////////////////////////////////////////////////////////
- while (element != null) {
- if (element.nodeName.toUpperCase() == "UNO") {
- uno = element.firstChild.nodeValue;
- }
- if (element.nodeName.toUpperCase() == "UNAME") {
- uname = element.firstChild.nodeValue;
- }
- if (element.nodeName.toUpperCase() == "LOUTCOMES") {
- loutcomes = element.firstChild.nodeValue;
- }
- if (element.nodeName.toUpperCase() == "PASS") {
- pass = element.firstChild.nodeValue;
- }
- if (element.nodeName.toUpperCase() == "MERIT") {
- merit = element.firstChild.nodeValue;
- }
- if (element.nodeName.toUpperCase() == "DISTINCTION") {
- distinction = element.firstChild.nodeValue;
- }
- element = element.nextSibling;
- }
- unit_info = unit_info.nextSibling;
- //////////////////////////////////////////////////////////////////////
- }
- unitH_txt.htmlText = "<font size='18' color='#00CC00'>"+uno+"</font>";
- unitT_txt.htmlText = "<font size='16'>"+uname+"</font>";
- loutcomes = UnitdataXMLNode.firstChild.childNodes[2].childNodes;
- //trace(loutcomes.length)
- for (i=0; i<loutcomes.length; i++) {
- var num = i+1;
- var info = UnitdataXMLNode.firstChild.childNodes[2].childNodes[i].firstChild.nodeValue;
- Mix += "<LI>"+info+"</LI>";
- //trace("LO"+num+" = "+info+".");
- }
- pass = UnitdataXMLNode.firstChild.childNodes[3].childNodes;
- //trace (pass.length);
- for (j=0; j<pass.length; j++) {
- var num = j+1;
- var info2 = UnitdataXMLNode.firstChild.childNodes[3].childNodes[j].firstChild.nodeValue;
- passInfo += "<LI>"+info2+"</LI>";
- //trace ("P"+num+" = "+info2+".")
- }
- merit = UnitdataXMLNode.firstChild.childNodes[4].childNodes;
- for (k=0; k<merit.length; k++) {
- var num = k+1;
- var info3 = UnitdataXMLNode.firstChild.childNodes[4].childNodes[k].firstChild.nodeValue;
- meritInfo += "<LI>"+info3+"</LI>";
- }
- dist = UnitdataXMLNode.firstChild.childNodes[5].childNodes;
- for (l=0; l<dist.length; l++) {
- var num = l+1;
- var info4 = UnitdataXMLNode.firstChild.childNodes[5].childNodes[l].firstChild.nodeValue;
- distInfo += "<LI>"+info4+"</LI>";
- }
- LO = "<font size='12'><UL>"+Mix+"</UL></font>";
- l1_txt.htmlText = LO;
- }
- }
et mon XML:
Code: [ Select ]
<UNIT>
<UNIT__INFO>
<UNO>Unit 8:</UNO>
<UNAME>Design and Principles in Art and Design</UNAME>
<LOUTCOMES>
<LO1>Understand how form relates to function in their own work</LO1>
<LO2>Be able to use appropriate materials in own work</LO2>
<LO3>Know how cultural associations affect their own work</LO3>
<LO4>Understand design for need and the repsonsibilities of designners</LO4>
</LOUTCOMES>
<PASS>
<P1>Explain how form relates to function in their own work</P1>
<P2>Use appropriate materials in their own design work</P2>
<P3>Explain how cultural associations affect their own work</P3>
<P4>Explain design for need and the responsibilities of the designer</P4>
</PASS>
<MERIT>
<M1>Demonstrate skills and understanding in applying aesthetic considerations to functional requirements in their finished design work</M1>
<M2>Show an effective and considered understanding of applying design principles when producing their own work</M2>
</MERIT>
<DISTINCTION>
<D1>Show an independent approach to research and the application of innovative design ideas.</D1>
<D2>Show how the evaluation undertaken in the designs stages has been applied to the development and production of exciting, coherent and individual design work.</D2>
</DISTINCTION>
</UNIT_INFO>
</UNIT>
<UNIT__INFO>
<UNO>Unit 8:</UNO>
<UNAME>Design and Principles in Art and Design</UNAME>
<LOUTCOMES>
<LO1>Understand how form relates to function in their own work</LO1>
<LO2>Be able to use appropriate materials in own work</LO2>
<LO3>Know how cultural associations affect their own work</LO3>
<LO4>Understand design for need and the repsonsibilities of designners</LO4>
</LOUTCOMES>
<PASS>
<P1>Explain how form relates to function in their own work</P1>
<P2>Use appropriate materials in their own design work</P2>
<P3>Explain how cultural associations affect their own work</P3>
<P4>Explain design for need and the responsibilities of the designer</P4>
</PASS>
<MERIT>
<M1>Demonstrate skills and understanding in applying aesthetic considerations to functional requirements in their finished design work</M1>
<M2>Show an effective and considered understanding of applying design principles when producing their own work</M2>
</MERIT>
<DISTINCTION>
<D1>Show an independent approach to research and the application of innovative design ideas.</D1>
<D2>Show how the evaluation undertaken in the designs stages has been applied to the development and production of exciting, coherent and individual design work.</D2>
</DISTINCTION>
</UNIT_INFO>
</UNIT>
- <UNIT>
- <UNIT__INFO>
- <UNO>Unit 8:</UNO>
- <UNAME>Design and Principles in Art and Design</UNAME>
- <LOUTCOMES>
- <LO1>Understand how form relates to function in their own work</LO1>
- <LO2>Be able to use appropriate materials in own work</LO2>
- <LO3>Know how cultural associations affect their own work</LO3>
- <LO4>Understand design for need and the repsonsibilities of designners</LO4>
- </LOUTCOMES>
- <PASS>
- <P1>Explain how form relates to function in their own work</P1>
- <P2>Use appropriate materials in their own design work</P2>
- <P3>Explain how cultural associations affect their own work</P3>
- <P4>Explain design for need and the responsibilities of the designer</P4>
- </PASS>
- <MERIT>
- <M1>Demonstrate skills and understanding in applying aesthetic considerations to functional requirements in their finished design work</M1>
- <M2>Show an effective and considered understanding of applying design principles when producing their own work</M2>
- </MERIT>
- <DISTINCTION>
- <D1>Show an independent approach to research and the application of innovative design ideas.</D1>
- <D2>Show how the evaluation undertaken in the designs stages has been applied to the development and production of exciting, coherent and individual design work.</D2>
- </DISTINCTION>
- </UNIT_INFO>
- </UNIT>
Toute conseils sur ce que je peux faire pour ranger It Up s'il vous plaît????
Attachments:
Attachments:
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Juin 15th, 2010, 3:12 am
- graphixboy
- Control + Z


- Inscription: Juil 11, 2005
- Messages: 1828
- Loc: In the Great White North
- Status: Offline
- playboxdesign
- Born


- Inscription: Juin 15, 2010
- Messages: 3
- Loc: UK
- Status: Offline
Il est le "undefined" lorsque vous appuyez sur le PM et D boutons. L'information vient mais je pense que c'est le nœud principal à savoir la
noeud Pass - qui n'est pas défini
alors que les 4 nœuds à l'intérieur il ya autorisé.
J'ai bidouillé genre de morceaux de code à partir d'un couple de tutoriels.
Je ne voulais pas codées en dur, j'ai voulu charger le xml et la boucle à travers les nœuds, les nœuds enfants et leurs enfants en utilisant les noeuds. longueur etc
Donc, je veux 3 boucles imbriquées -, mais je devenais alors confondue avec la syntaxe pour les nœuds. Je voudrais vraiment quelque ordre non le code codées en dur. J'allais commencer dans le code pseudo pour essayer de travailler tout ça à partir de là...genre de perdu un peu de vapeur d'eau en ce moment, il faisait mon mal à la tête
noeud Pass - qui n'est pas défini
alors que les 4 nœuds à l'intérieur il ya autorisé.
J'ai bidouillé genre de morceaux de code à partir d'un couple de tutoriels.
Je ne voulais pas codées en dur, j'ai voulu charger le xml et la boucle à travers les nœuds, les nœuds enfants et leurs enfants en utilisant les noeuds. longueur etc
Donc, je veux 3 boucles imbriquées -, mais je devenais alors confondue avec la syntaxe pour les nœuds. Je voudrais vraiment quelque ordre non le code codées en dur. J'allais commencer dans le code pseudo pour essayer de travailler tout ça à partir de là...genre de perdu un peu de vapeur d'eau en ce moment, il faisait mon mal à la tête
- playboxdesign
- Born


- Inscription: Juin 15, 2010
- Messages: 3
- Loc: UK
- Status: Offline
Page 1 sur 1
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
Afficher de l'information
- Total des messages de ce sujet: 4 messages
- Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 55 invités
- Vous ne pouvez pas poster de nouveaux sujets
- Vous ne pouvez pas répondre aux sujets
- Vous ne pouvez pas éditer vos messages
- Vous ne pouvez pas supprimer vos messages
- Vous ne pouvez pas joindre des fichiers
