Resolving paths
Posted: Fri Dec 23, 2011 12:22 am
I need to build on my previous post for using oxy_substring and an attribute. That part is now working fine.
Now that I can grab the value of xlink:href after "IETM://" I need to resolve what folder in which XML file resides.
EXAMPLE XML:
<link xlink:href="IETM://O0013"/>
<link xlink:href="IETM://M0024"/>
<link xlink:href="IETM://T0024"/>
If the current file I'm editing is say M0013.xml, then of the three links, M0024.xml is in my current folder. However both the first and third files O0013 and T0024 are in different sibling folders.
From the first letter of the file name I know which folder the file in. For instance, O0013 is the "Operator Instructions" folder. T0024 is in the Troubleshooting folder.
Code in my current CSS that grabs the value of attribute "xlink:href":
link:before {
link: oxy_substring(attr(xlink|href), 7)".xml" !important;
content:url(img/link.png);
}
I've found that if I'm currently editing a Maintenance file, this will open a file in Operator folder:
link:before {
link: oxy_concat('../Operator Instructions/',oxy_substring(attr(xlink|href), 7))".xml" !important;
content:url(img/link.png);
}
However I need to be able to make a decision on what folder to retrieve a file from based the the first letter of the substring result.
Is this possible within CSS? or would this require some kind of Java programming?
Thanks.
Charles
Now that I can grab the value of xlink:href after "IETM://" I need to resolve what folder in which XML file resides.
EXAMPLE XML:
<link xlink:href="IETM://O0013"/>
<link xlink:href="IETM://M0024"/>
<link xlink:href="IETM://T0024"/>
If the current file I'm editing is say M0013.xml, then of the three links, M0024.xml is in my current folder. However both the first and third files O0013 and T0024 are in different sibling folders.
From the first letter of the file name I know which folder the file in. For instance, O0013 is the "Operator Instructions" folder. T0024 is in the Troubleshooting folder.
Code in my current CSS that grabs the value of attribute "xlink:href":
link:before {
link: oxy_substring(attr(xlink|href), 7)".xml" !important;
content:url(img/link.png);
}
I've found that if I'm currently editing a Maintenance file, this will open a file in Operator folder:
link:before {
link: oxy_concat('../Operator Instructions/',oxy_substring(attr(xlink|href), 7))".xml" !important;
content:url(img/link.png);
}
However I need to be able to make a decision on what folder to retrieve a file from based the the first letter of the substring result.
Is this possible within CSS? or would this require some kind of Java programming?
Thanks.
Charles