Carlos
07-14-2004, 09:21 AM
Hi, I'm working with an SVG that has definitions like this:
<path fme:FNODE_="0" fme:TNODE_="0" fme:LPOLY_="0" fme:RPOLY_="0" fme:LENGTH="3271.706" fme:ROADS_="3534" fme:ROADS_ID="3534" fme:LINK_ID="06404-10424" fme:JUR="7" fme:NHS="Y" fme:ROUTE_ID="I95" fme:NAME="I95 northbound" fme:FROM_="ramp to Russell Road" fme:TO="ramp from VA 619 - Joplin Road" fme:COUNTY="Prince William" fme:AADT1986="53480" fme:CT86="1" fme:AADT1987="58230" fme:CT87="1" fme:AADT1988="63370" fme:CT88="1" fme:AADT1989="66740" fme:CT89="1" fme:AADT1990="85280" fme:CT90="1" fme:AADT1991="87000" fme:CT91="1" fme:AADT1992="94000" fme:CT92="1" fme:AADT1993="96000" fme:CT93="1" fme:AADT1994="99000" fme:CT94="1" fme:AADT1995="104000" fme:CT95="1" fme:AADT1996="106000" fme:CT96="1" fme:AADT1997="110000" fme:CT97="1" fme:REMARKS="" fme:FTYPE="1" fme:SEQUENCE="18" fme:SEGMENT="6" fme:STATE="VA" fme:LOG_SEQ="6.18" fme:URB_AREA="N" fme:PERMCOUNT="" fme:TRAVTIME="0" fme:I95CORRIDO="" fme:SELECT_="" d="M 0.336731,1.33785e-008 l 0.000272867,0.000857617 "/>
In javascript, how do I extract invidual items on that list?
Thanks.
Anonymous
07-14-2004, 11:25 AM
You have to define your namespace fme and then use
your_path.getAttributeNS(your_namespace,FNODE_) by example
Do you try getAttribute("fme:FNODE_") ?
Michel
Anonymous
07-15-2004, 01:04 PM
no i haven't tried that, new to both svg and scripting
getAttribute("fme:FNODE_")
worked, tho,
merci beacoup!
You have to define your namespace fme and then use
your_path.getAttributeNS(your_namespace,FNODE_) by example
Do you try getAttribute("fme:FNODE_") ?
Michel
Anonymous
08-26-2004, 02:22 AM
Are you using FME's SVG translation? If so, then there is some templates in the FME home directory that can be used as a guide for the FME attribute extraction.
Hi, I'm working with an SVG that has definitions like this:
<path fme:FNODE_="0" fme:TNODE_="0" fme:LPOLY_="0" fme:RPOLY_="0" fme:LENGTH="3271.706" fme:ROADS_="3534" fme:ROADS_ID="3534" fme:LINK_ID="06404-10424" fme:JUR="7" fme:NHS="Y" fme:ROUTE_ID="I95" fme:NAME="I95 northbound" fme:FROM_="ramp to Russell Road" fme:TO="ramp from VA 619 - Joplin Road" fme:COUNTY="Prince William" fme:AADT1986="53480" fme:CT86="1" fme:AADT1987="58230" fme:CT87="1" fme:AADT1988="63370" fme:CT88="1" fme:AADT1989="66740" fme:CT89="1" fme:AADT1990="85280" fme:CT90="1" fme:AADT1991="87000" fme:CT91="1" fme:AADT1992="94000" fme:CT92="1" fme:AADT1993="96000" fme:CT93="1" fme:AADT1994="99000" fme:CT94="1" fme:AADT1995="104000" fme:CT95="1" fme:AADT1996="106000" fme:CT96="1" fme:AADT1997="110000" fme:CT97="1" fme:REMARKS="" fme:FTYPE="1" fme:SEQUENCE="18" fme:SEGMENT="6" fme:STATE="VA" fme:LOG_SEQ="6.18" fme:URB_AREA="N" fme:PERMCOUNT="" fme:TRAVTIME="0" fme:I95CORRIDO="" fme:SELECT_="" d="M 0.336731,1.33785e-008 l 0.000272867,0.000857617 "/>
In javascript, how do I extract invidual items on that list?
Thanks.
Anonymous
08-26-2004, 02:27 AM
Here is an example javascript function that will extract the attibutes you want...the function is event based, but you can modify it the way that you want...
function getFMEAttrs(evt)
{
attributes = evt.target.getAttributes();
string = "";
for(i = 0; i < attributes.getLength(); i++)
{
attrName = attributes.item(i).getName();
attrValue = attributes.item(i).getValue();
ns = attrName.substring(0,4);
if(ns == "fme:")
{
string = string + attrName.substring(4,attrName.length) + " = ";
string = string + attrValue + "\n";
}
}
alert(string);
}
Hi, I'm working with an SVG that has definitions like this:
<path fme:FNODE_="0" fme:TNODE_="0" fme:LPOLY_="0" fme:RPOLY_="0" fme:LENGTH="3271.706" fme:ROADS_="3534" fme:ROADS_ID="3534" fme:LINK_ID="06404-10424" fme:JUR="7" fme:NHS="Y" fme:ROUTE_ID="I95" fme:NAME="I95 northbound" fme:FROM_="ramp to Russell Road" fme:TO="ramp from VA 619 - Joplin Road" fme:COUNTY="Prince William" fme:AADT1986="53480" fme:CT86="1" fme:AADT1987="58230" fme:CT87="1" fme:AADT1988="63370" fme:CT88="1" fme:AADT1989="66740" fme:CT89="1" fme:AADT1990="85280" fme:CT90="1" fme:AADT1991="87000" fme:CT91="1" fme:AADT1992="94000" fme:CT92="1" fme:AADT1993="96000" fme:CT93="1" fme:AADT1994="99000" fme:CT94="1" fme:AADT1995="104000" fme:CT95="1" fme:AADT1996="106000" fme:CT96="1" fme:AADT1997="110000" fme:CT97="1" fme:REMARKS="" fme:FTYPE="1" fme:SEQUENCE="18" fme:SEGMENT="6" fme:STATE="VA" fme:LOG_SEQ="6.18" fme:URB_AREA="N" fme:PERMCOUNT="" fme:TRAVTIME="0" fme:I95CORRIDO="" fme:SELECT_="" d="M 0.336731,1.33785e-008 l 0.000272867,0.000857617 "/>
In javascript, how do I extract invidual items on that list?
Thanks.