If (XML){ javascript.generateErrors()} *grrr*
Hi,
I've written an XSL-File who reads out an XML. The XSL file should also use an JavaScript to check user input. But it wouldnt work. It always says ")" is missing in Line....! I4ve made an tTest output of the JavaScript as text in browser and used it to make a html file without XSL. Now it works. the error is at the WHILE-loop. If i remove the loop the error comes at the IF. All is working perfect if i remove IF and WHILE.
Can anybody help?
much Thanks :)
F.Falk
there is my XSL file:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<head>
<script language="JavaScript"> <![CDATA[
function onTest()
var namen;
var varValue;
var helpStr;
var ErrE="]]><xsl:value-of select="Vars/Errors/ErrE"/><![CDATA[";
var ErrA="]]><xsl:value-of select="Vars/Errors/ErrA"/><![CDATA[";
var ErrMinI="]]><xsl:value-of select="Vars/Errors/ErrMinI"/><![CDATA[";
var ErrMaxI="]]><xsl:value-of select="Vars/Errors/ErrMaxI"/><![CDATA[";
var ErrStr="]]><xsl:value-of select="Vars/Errors/ErrStr"/><![CDATA[";
var a=0;
while (a < 1){
]]>
<xsl:for-each select="Vars/Var">
<xsl:if match=".[xtype='Integer']">
<![CDATA[
minVal=]]><xsl:value-of select="xMinval"/><![CDATA[;
maxVal=]]><xsl:value-of select="xMaxval"/><![CDATA[;
varValue=document.XSL.]]><xsl:value-of select="xName"/><![CDATA[.value;
if (!((varValue <= maxVal) && (varValue >= minVal)))
alert(ErrA+"
]]>
<xsl:value-of select="xHelpStr"/>
<![CDATA[\n"+ErrE +" ]]>
<![CDATA[\n"+ ErrMinI +"]]>
<xsl:value-of select="xMinval"/>
<![CDATA["+ ErrMaxI +"]]>
<xsl:value-of select="xMaxval"/>
<![CDATA[");
document.XSL.]]><xsl:value-of select="xName"/><![CDATA[.focus();
break;
]]>
</xsl:if>
</xsl:for-each>
<![CDATA[
a=1;
}]]>
</script>
</head>
<Body>
<form name="XSL">
<basefont size="1" face="Arial">
<xsl:for-each select="Vars/Var">
<xsl:if match=".[xtype='Integer']">
<p>Mindestwert: <xsl:value-of select="xMinval"/></p>
<p>Maximalwert: <xsl:value-of select="xMaxval"/></p>
<b><p><xsl:value-of select="xHelpStr"/></p>Current Value:</b>
<input>
<xsl:attribute name="value"><xsl:value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
</input>
<p><xsl:value-of select ="xName"/></p>
<p>-------------------<br></br></p>
</xsl:if>
<xsl:if match=".[xtype='String']">
<b><p><xsl:value-of select="xHelpStr"/></p></b>
<p>Maximale Laenge: <xsl:value-of select="xMaxLength"/></p>
<b>Current Value:</b>
<input>
<xsl:attribute name="value"><xsl:value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
</input>
<p><xsl:value-of select ="xName"/></p>
<p>-------------------<br></br></p>
</xsl:if>
<xsl:if match=".[xtype='Boolean']">
<b><p><xsl:value-of select="xHelpStr"/></p></b>
<b>Current Value:</b>
<xsl:if match=".[xValue='1']">
<input type="checkbox">
<xsl:attribute name="value"><xsl:value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
<xsl:attribute name="checked"></xsl:attribute>
</input>
</xsl:if>
<xsl:if match=".[xValue='0']">
<input type="checkbox">
<xsl:attribute name="value"><xsl :value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
</input>
</xsl:if>
<p>-------------------<br></br></p>
</xsl:if>
<xsl:if match=".[xtype='Enumerator']">
<select>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
<xsl:for-each select="xEnum_Str">
<option>
<xsl:attribute name="value"><xsl:value-of select ="xStr"/></xsl:attribute>
<xsl:value-of select ="xStr"/>
</option>
</xsl:for-each>
</select>
<p>-------------------<br></br></p>
</xsl:if>
</xsl:for-each>
<input type="Button" value="Save" onClick="onTest()"></input>
</basefont>
</form>
</Body>
</HTML>
</xsl:template>
</xsl:stylesheet>
and there is my XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="test.xsl" type="text/xsl" ?>
<Vars>
<Errors>
<ErrA>Fehler in Feld:</ErrA>
<ErrE>Der eingegebene Wert liegt nicht im Gueltigkeitsbereich:</ErrE>
<ErrMinI>Mindestwert: </ErrMinI>
<ErrMaxI>Maximalwert: </ErrMaxI>
<ErrStr>Maximale Laenge: </ErrStr>
</Errors>
<Var Id="1">
<xName>int_9</xName>
<xValue>95</xValue>
<xtype>Integer</xtype>
<xMinval>0</xMinval>
<xMaxval>100</xMaxval>
<xHelpStr>Eine Leberwurst mit Integertr|ffeln</xHelpStr>
</Var>
<Var Id="2">
<xName>int_10</xName>
<xValue>95</xValue>
<xtype>Integer</xtype>
<xMinval>0</xMinval>
<xMaxval>100</xMaxval>
<xHelpStr>Ein Integer mit einem Integer als Inhalt</xHelpStr>
</Var>
<Var Id="3">
<xName>Str_1</xName>
<xValue></xValue>
<xtype>String</xtype>
<xMaxLength></xMaxLength>
<xHelpStr>Ein String zur Ausrichtung des Froschgesangs</xHelpStr>
</Var>
<Var Id="4">
<xName>bHuberli</xName>
<xWert>1</xWert>
<xtype>Boolean</xtype>
<xHelpStr>Ein Boolean: Wurde JFK erschossen oder hat er nur urlaub? Die Frage erlaubt keine Wahr/Falsch? </xHelpStr>
<xValue>1</xValue>
</Var>
<Var Id="5">
<xName>enList</xName>
<xValue>huhu</xValue>
<xtype>Enumerator</xtype>
<xEnum_Str Id="1"><xStr>Hallo</xStr></xEnum_Str>
<xEnum_Str Id="2"><xStr>Die</xStr></xEnum_Str>
<xEnum_Str Id="3"><xStr>Herren</xStr></xEnum_Str>
<xEnum_Str Id="4"><xStr>Eierkvpfe</xStr></xEnum_Str>
</Var>
</Vars>
Hi,
I've written an XSL-File who reads out an XML. The XSL file should also use an JavaScript to check user input. But it wouldnt work. It always says ")" is missing in Line....! I4ve made an tTest output of the JavaScript as text in browser and used it to make a html file without XSL. Now it works. the error is at the WHILE-loop. If i remove the loop the error comes at the IF. All is working perfect if i remove IF and WHILE.
Can anybody help?
much Thanks :)
F.Falk
there is my XSL file:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<head>
<script language="JavaScript"> <![CDATA[
function onTest()
var namen;
var varValue;
var helpStr;
var ErrE="]]><xsl:value-of select="Vars/Errors/ErrE"/><![CDATA[";
var ErrA="]]><xsl:value-of select="Vars/Errors/ErrA"/><![CDATA[";
var ErrMinI="]]><xsl:value-of select="Vars/Errors/ErrMinI"/><![CDATA[";
var ErrMaxI="]]><xsl:value-of select="Vars/Errors/ErrMaxI"/><![CDATA[";
var ErrStr="]]><xsl:value-of select="Vars/Errors/ErrStr"/><![CDATA[";
var a=0;
while (a < 1){
]]>
<xsl:for-each select="Vars/Var">
<xsl:if match=".[xtype='Integer']">
<![CDATA[
minVal=]]><xsl:value-of select="xMinval"/><![CDATA[;
maxVal=]]><xsl:value-of select="xMaxval"/><![CDATA[;
varValue=document.XSL.]]><xsl:value-of select="xName"/><![CDATA[.value;
if (!((varValue <= maxVal) && (varValue >= minVal)))
alert(ErrA+"
]]>
<xsl:value-of select="xHelpStr"/>
<![CDATA[\n"+ErrE +" ]]>
<![CDATA[\n"+ ErrMinI +"]]>
<xsl:value-of select="xMinval"/>
<![CDATA["+ ErrMaxI +"]]>
<xsl:value-of select="xMaxval"/>
<![CDATA[");
document.XSL.]]><xsl:value-of select="xName"/><![CDATA[.focus();
break;
]]>
</xsl:if>
</xsl:for-each>
<![CDATA[
a=1;
}]]>
</script>
</head>
<Body>
<form name="XSL">
<basefont size="1" face="Arial">
<xsl:for-each select="Vars/Var">
<xsl:if match=".[xtype='Integer']">
<p>Mindestwert: <xsl:value-of select="xMinval"/></p>
<p>Maximalwert: <xsl:value-of select="xMaxval"/></p>
<b><p><xsl:value-of select="xHelpStr"/></p>Current Value:</b>
<input>
<xsl:attribute name="value"><xsl:value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
</input>
<p><xsl:value-of select ="xName"/></p>
<p>-------------------<br></br></p>
</xsl:if>
<xsl:if match=".[xtype='String']">
<b><p><xsl:value-of select="xHelpStr"/></p></b>
<p>Maximale Laenge: <xsl:value-of select="xMaxLength"/></p>
<b>Current Value:</b>
<input>
<xsl:attribute name="value"><xsl:value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
</input>
<p><xsl:value-of select ="xName"/></p>
<p>-------------------<br></br></p>
</xsl:if>
<xsl:if match=".[xtype='Boolean']">
<b><p><xsl:value-of select="xHelpStr"/></p></b>
<b>Current Value:</b>
<xsl:if match=".[xValue='1']">
<input type="checkbox">
<xsl:attribute name="value"><xsl:value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
<xsl:attribute name="checked"></xsl:attribute>
</input>
</xsl:if>
<xsl:if match=".[xValue='0']">
<input type="checkbox">
<xsl:attribute name="value"><xsl :value-of select ="xValue"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
</input>
</xsl:if>
<p>-------------------<br></br></p>
</xsl:if>
<xsl:if match=".[xtype='Enumerator']">
<select>
<xsl:attribute name="name"><xsl:value-of select ="xName"/></xsl:attribute>
<xsl:for-each select="xEnum_Str">
<option>
<xsl:attribute name="value"><xsl:value-of select ="xStr"/></xsl:attribute>
<xsl:value-of select ="xStr"/>
</option>
</xsl:for-each>
</select>
<p>-------------------<br></br></p>
</xsl:if>
</xsl:for-each>
<input type="Button" value="Save" onClick="onTest()"></input>
</basefont>
</form>
</Body>
</HTML>
</xsl:template>
</xsl:stylesheet>
and there is my XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="test.xsl" type="text/xsl" ?>
<Vars>
<Errors>
<ErrA>Fehler in Feld:</ErrA>
<ErrE>Der eingegebene Wert liegt nicht im Gueltigkeitsbereich:</ErrE>
<ErrMinI>Mindestwert: </ErrMinI>
<ErrMaxI>Maximalwert: </ErrMaxI>
<ErrStr>Maximale Laenge: </ErrStr>
</Errors>
<Var Id="1">
<xName>int_9</xName>
<xValue>95</xValue>
<xtype>Integer</xtype>
<xMinval>0</xMinval>
<xMaxval>100</xMaxval>
<xHelpStr>Eine Leberwurst mit Integertr|ffeln</xHelpStr>
</Var>
<Var Id="2">
<xName>int_10</xName>
<xValue>95</xValue>
<xtype>Integer</xtype>
<xMinval>0</xMinval>
<xMaxval>100</xMaxval>
<xHelpStr>Ein Integer mit einem Integer als Inhalt</xHelpStr>
</Var>
<Var Id="3">
<xName>Str_1</xName>
<xValue></xValue>
<xtype>String</xtype>
<xMaxLength></xMaxLength>
<xHelpStr>Ein String zur Ausrichtung des Froschgesangs</xHelpStr>
</Var>
<Var Id="4">
<xName>bHuberli</xName>
<xWert>1</xWert>
<xtype>Boolean</xtype>
<xHelpStr>Ein Boolean: Wurde JFK erschossen oder hat er nur urlaub? Die Frage erlaubt keine Wahr/Falsch? </xHelpStr>
<xValue>1</xValue>
</Var>
<Var Id="5">
<xName>enList</xName>
<xValue>huhu</xValue>
<xtype>Enumerator</xtype>
<xEnum_Str Id="1"><xStr>Hallo</xStr></xEnum_Str>
<xEnum_Str Id="2"><xStr>Die</xStr></xEnum_Str>
<xEnum_Str Id="3"><xStr>Herren</xStr></xEnum_Str>
<xEnum_Str Id="4"><xStr>Eierkvpfe</xStr></xEnum_Str>
</Var>
</Vars>
Similar Messages
-
Catalog pricing challenge (idml, xml, javascript solution?)
Greetings,
I have a very large challenge that i desperately need help with.
I am working on a 1000+ page catalog with over 30,000 products in it. The pages come to our studio from a master database much like the example image I have inserted below ---> and inline list of product names, images, Specs and Tables. We then apply formatting and arrange the items into a paginated layout. Basic InDesign stuff.
The problem comes at the end (After pagination of 1000+ pages). These files do not come in with final pricing and we then need to update it to reflect the current pricing for the items. We have been using a plugin that interfaces with our database to flow in pricing and it has worked O.K.(we have had many bugs along the way). We recently updated our database software and the ID plugin that goes with it and have lost the functionality to update pricing (UGGGGHHHH, they are "working on it") which renders this very expensive product useless. : ( sad face
We have researched a large number of 3rd party solutions (plugins, software, etc.) to change/enhance our workflow but unfortunately all of them have trouble interfacing with our database software and cannot be implemented without a very large, pricey and time consuming conversion. (trust me, I have done over 15 demos of all the major plugins and services, small to large)
My solution/workaround for this problem of updated pricing for 30,000+ products perhaps could be a simple solution that goes like this:
1. Receive ID CS6 files.
2. Complete pagination of IDCS6 files.
3. Export .idml for paginated files.
4. Export a mirrored IDCS6 file from the database with all the same data, images, tables, etc. with updated pricing.
5. Export .idml from mirrored file.
6. Convert both .idml files to .zip files and replace the .xml containing the Story Data (Located at Catalog_Paginated.zip\XML\Stories) with the exported Story data from the mirrored files .zip package
(Located again at Catalog_Mirrored.zip\XML\Stories).
7. Convert paginated files .zip back to .idml and open in IDCS6 which should now have the new Story data and in turn updated pricing.
I have tried this and in short I get a file that is hung up and will not open. Keep in mind that i do not do all 30,000 products in one ID file. They are exported in chunks of 20 to 30 products. This works perfectly on a small scale document such as in my attached example pic, but has trouble with a large file with more complex product data and tables.
This is where i need help. Am I barking up the wrong tree? Am I simply replacing the wrong .xml data in the .idml/.zip file? Is there a JavaScript solution to update/replace the .xml data?
I feel strongly that the robust data offered in the .idml format (perhaps in conjunction with a scripting solution) can offer an ideal solution in this problem as oppose to pursuing a costly and time consuming transfer to a new plugin/software solution.
I have some help from a very talented (and very busy) team of developers working on a JavaScript solution but I am pursuing this .idml solution myself and REALLLLLLY NEED HELP as we are falling behind in production as we speak.
In short, this should be simple. What am i doing wrong?lazycarpenter
I oversee the catalog production for a major autoparts distributor here in the midwestern United States. Our catalog is 886 pages including an index. If you are looking for price updating for InDesign go look at this product called AutoPrice:
http://www.meadowsps.com/site/details/autoprice_detail.htm
What you might find unique with this product is the batch processing feature and reporting..In certain cases the reports this software generates has proven invaluable for for my team. If you say your catalog is 1000 pages you could easily update this in or around an hours time (via the batch processing feature). We've used AutoPrice since the dark days when Quark dominated the industry..probably around 15 years. This is also available for CS6 as you mention above. If you do look at this program it would be interesting to know how it turned out for your dilema. Good Luck!
Doug Fehr -
When I use my ultra edit to view this file locally, it executes perfectly. When I upload this to my server, I show no results. The xml feed is from an outside vendor, and it is well formed. My xsl is also well formed. The xml link is correct, just did not display it in full in the forum. Can someone help me?
"The error i receive is at line 9 char 2. Access is denied"
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<html>
<head>
<script type="text/javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("MYXML.xml")
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("test.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
</head>
<body>
<xsl:template match="/">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<xsl:value-of select="result/relatedsearches/relation" />
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
</body>
</html>If all you're doing is wanting to style a page client-side, the best way to go about it is to stick a <?xml-stylesheet?> header on the XML file to link to the XSL and ship it to the client as-is.
You'll probably have to detect the client version when you send the prologue because IE doesn't comply with the specification (so what's new...)
For IE:
<?xml-stylesheet type="text/xsl" href="mystyle.xsl"?>
For Compliant browsers:
<?xml-stylesheet type="application/xsl+xml" href="mystyle.xsl"?> -
XML format for Acrobat JavaScript
Hi,
This is my first posting to any Adobe forum, so please bear with me...
I'm interested in the XML format for Acrobat JavaScript. I'll be using an external editor (UltraEdit). When I do (in Acrobat 8) Advanced-->Document Processing-->Edit All JavaScripts, UltraEdit starts off with this:
//-----------------Do not edit the XML tags--------------------
Interesting, but not very useful. If I look at some existing PDF files containing JavaScript, I see things like:
//-----------------Do not edit the XML tags--------------------
//<Document-Level>
//<ACRO_source>DocOpen</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:DocOpen ***********/
OK, this is better. In fact, if I look at enough existing PDF files containing JavaScript, I could probably figure out the XML format by myself, including the XML format of tags like <Page-Actions>, <AcroForm>, etc. However, it would be far easier to get the specification of the JavaScript XML format -- for example, what is the format of the text following the "belongs to:" string within the various types of XML tags?
I *presume* this is documented somewhere but I couldn't find it. If someone has the Acrobat JavaScript XML format specification, it would be greatly appreciated.
Thanks.
Dave
P.S. Another possible approach would be to create JavaScripts myself using Advanced-->Document Processing-->Document JavaScripts, and then see what XML is created based on the code I enter into the GUI, e.g. form code, functions, etc. This also seems somewhat inefficient, presuming again that the JavaScript XML format is already documented.Thanks for the additional information.
I played with JavaScript some more, using my preferred editor, UltraEdit, which I attached to Acrobat. I thought I would be able to take a JavaScript program from one PDF file (source file) and do a copy & paste into another PDF file (destination file). While I can do the paste (again, via UltraEdit) into the destination file and can do an UltraEdit Save, when I go back into UltraEdit via Advanced --> Document Processing --> Edit All JavaScripts, the JavaScript I pasted from the source file to the destination file isn't there in the destination file.
From this, I concluded that I'll need to create the Document-level JavaScript and the form field Javascripts (e.g. a JavaScript triggered by a "Mouse Down" in a button) via the Acrobat GUI's. Acrobat doesn't seem to like it if I bypass the GUIs and just attempt to paste the code directly into the PDF file via an editor. By not using the GUI and just doing the cut & paste as I did, I'm probably missing some part of the code setup/creation process that Acrobat needs to know about.
This is why I originally asked about the syntax for the pseudo-XML, thinking I could just copy the pseudo-XML/JavaScript code from one PDF file to another, and then modify the code to reflect the needs of the destination PDF. Now I understand the need you mentioned to use the Acrobat GUIs to set up the initial XML/JavaScript structure.
Once I have the XML structure set up in the destination file (e.g. a JavaScript triggered by a "Mouse Down" in a button), I can obviously copy code snippets into that <AcroForm> sections, I just can't *create* the original "Mouse Down" <AcroForm> sections via the editor.
Another approach I could follow would be to make a copy of the original source file and change the name of the copy to the desired destination file name, and then start modifying the code in the new (destination) file -- presuming that's the easiest path to get the desired functionality created. This way, I wouldn't have to manually (via the Acrobat GUI) create all of the <Document-Level> and <AcroForm> sections.
Thanks for your (and others') help, let me know if I'm missing anything.
Dave -
XML data with nested repeating nodes
First let me prelude with my skill set; "I am an XML,
JavaScript and Spry newbie". My xml data looks like this:
<report>
<header>
<column type="[string|real|int]>some
value</column>
<column type="[string|real|int]>some
value</column>
</header>
<details>
<row>
<cell type="[string|real|int]">some value</cell>
<cell type="[string|real|int]">some value</cell>
</row>
<row>
<cell type="[string|real|int]">some value</cell>
<cell type="[string|real|int]">some value</cell>
</row>
</details>
</report>
- report/header/column is completely dynamic and not known in
advance
- each report/header/column is the table column name value
- each report/details/row/cell is the table cell value
- type="[string|real|int]" is data type of the cell value
Using Spry 1.5 I have been able to successfully populate the
table column header row dynamically and repeat the appropriate
number of rows.
Spry is Cool!
I have not been able to figure out how to repeat
report/details/row/cell for each repeating row node. If I nest
spry:repeat it appears to go into an endless loop.
I will also need to equate data type to a Spry data type so
that I may sort the columns appropriately for their respective data
type.
Here is the code I have so far:
<script language="JavaScript" type="text/javascript"
src="includes/xpath.js"></script>
<script language="JavaScript" type="text/javascript"
src="includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript"
src="includes/SpryNestedXMLDataSet.js"></script>
<script type="text/javascript">
var dsReport = new
Spry.Data.XMLDataSet("data/cmbcov_raw.xml", "/iqreport");
var dsHeaders = new Spry.Data.NestedXMLDataSet(dsReport,
"header/column");
var dsRows = new Spry.Data.NestedXMLDataSet(dsReport,
"details/row");
var dsCells = new Spry.Data.NestedXMLDataSet(dsReport,
"details/row/cell");
Spry.Data.Region.debug = true;
</script>
<link href="/report/css/samples.css" rel="stylesheet"
type="text/css" media="all" />
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Reports</title>
</head>
<body>
<h3
spry:region="dsReport">{dsReport::@title}</h3>
<div class="liveSample" spry:region="dsReport dsHeaders
dsRows dsCells">
<table class="dataTable">
<tr>
<th
spry:repeat="dsHeaders">{dsHeaders::column}</th>
</tr>
<tbody>
<tr spry:repeat="dsRows">
<td>{dsCells::cell}</td> <!--if I use
spry:repeat here browser hangs - endless loop?-->
</tr>
</tbody>
</table>
</div>
</body>
</html>
Your assistance will be greatly appreciated!
Thank you in advance,
nomadcanuckDon,
Thanks for forcing me to read the nested data set sample
again, three times the charm as they say :). I made the following
addition to get it to work.
var dsDetails = new Spry.Data.NestedXMLDataSet(dsReport,
"details");
var dsRows = new Spry.Data.NestedXMLDataSet(dsDetails,
"row");
var dsCells = new Spry.Data.NestedXMLDataSet(dsRows, "cell");
<tbody spry:repeat="dsDetails">
<tr spry:repeat="dsRows">
<td spry:repeat="dsCells">{dsCells::cell}</td>
</tr>
</tbody>
I am still stumped with respect to sorting the dynamic
header/column. Any chance of being pointed in the right direction,
either document or hint is appreciated.
Thanks again,
nomadcanuck -
Access image placed by xml-rules
Hi, I have to modify an image (width/height) which is placed by xml-rules.
XML:
>
>
>
JavaScript:
> function SymbolRule() {
> this.name = "Symbol";
> this.xpath = "//sometag/Symbol[@typ='new']";
> this.apply = function (element, ruleProcessor) {
> with (element) {
> applyObjectStyle("somestyle");
> }
How can I now access this image to modify its properties?
I've read http://www.adobeforums.com/webx/.59b7295a/2 but I don't understand *where* to place the code to access the image. Is it possible to do it in my XML-Rule SymbolRule()? Or is it "to early" because the image is no yet placed in the document?I have the exact same issue!
My problem occurs after I unthread the document. After unthreading, the elements parent changes to XmlStory and I can't locate the parent page/spread.
It's an anchored textframe within a table cell. So parent path is like so:
obj (textframe) -> Character -> Cell -> Table -> XmlStory -> Document
In InDesign I can see that the object is on the page and visible.
I would like to get to the page.
Any help would be greatly appreciated.
Thanks
Ruvan -
I'm a java dev, not an oracle admin, so please be gentle!
I've mapped the physical structure of 10 types of devices to 10 XML schemas. These devices have a lot of common attributes (id, location, usage, etc) so I've kept these out of the schemas and, instead, wanted to store them in the DB relationally.
My first instinct was to create a table like:
id varchar2(20),
inventory_xml sys.xmltype
location varchar2(20)
usage varchar2(20)
If I wanted to use Oracle XML DB, though, the "inventory_xml" field does not contain the same type of XML element, because they can be any of 10 different devices, so I can't map the column to a schema. The solutions I came up with are:
1) Wrap the elements in a "device" element so that they are all the same element type. This seems like a hack, however, and goes against the spirit of XML DB.
2) Create a table for each device type, which includes the "id" as a foreign key and the xml data. Then, in the main table, replace the "inventory_xml sys.xmltype" column with "device_type_table varchar2(20)" which stored the name of the correct table.
I have no idea whether this is a good database practice or not, so any suggestions would be appreciated. The reason I want to use XML DB is that the extracts are super fast when you map the xml fields to schemas so queries would take milliseconds instead of 10's of seconds.garcol wrote:
Hello,
I would like to refresh a region based on a database procedure (it generates html/xml/javascript with SVG).
The layout of the region is generated by the procedure. But when the data changes, the region layout has to change too.
That's why I have made a button with label 'Refresh Region'. I was hoping when a user clicks on it, the region is refreshed. But it does not work (via Dynamic action).
How do I make the region refresh (actually run the procedure again and show the result..).The built-in Refresh dynamic action can only refresh interactive reports, standard reports, charts, and list regions. My initial approach would therefore be to consider rewriting the procedure as a standard report. (I have rarely—if ever—seen a Dynamic PL/SQL region that isn't better implemented as a report with a custom template.)
The other obvious possibility would be to run the procedure as an on-demand process and display/refresh it using an AJAX/JavaScript DA. -
Hi,
I want import the XML (ask user to select xml file) and run the xslt then open the new document after that to place the convert style and tagged text file in InDesign. I need all function in using one script (java script). I am using InDesign CS2. I have no more knowledge about java script. Can anyone give me one script to run all tool in one script file in inside the InDesign Document.
My files are...
1. XML file
2. XSLT File
3. Ind Template
Thanks for help.
ByomokeshHi
Maybe looking in the Adobe's documentation ?
http://www.adobe.com/devnet/bridge/pdfs/javascript_tools_guide_cs3.pdf
It deals deeply with xml & javascript.
Ok it's CS3 but reference manual for CS2 contains xml method and properties so working with these two documents should be helpful.
Sorry not for helping better but I never used xml and js.
Loic -
I'm trying to understand the Photo Gallery demo so I can
replicate the function for use on various sites. I've copied the
html, xml, javascript and some of the photo file elements to my
hard drive. I initially modified the file structures to something
more of my liking, but had some problems with the links. I've since
mimicked the structures so I can reduce the initial errors, but I
am stumped at the var dsGallery and var dsPhotos statements that
dynamically link to the China, Paris and Egypt photo databases. In
the original dynamic definition, DreamWeaver only parses the
dsGalleries XML definition, not defining the dsGallery and dsPhoto
nodes. I wasn't too concerned about that given the variable nature,
but nothing except the pull-down menu and controls displayed in the
browser. DreamWeaver shows correct parsing of the dsGalleries XML,
dsGallery and dsPhoto nodes only when I eliminate the dynamic
linking and set it to one of the static links (Egypt). This fails
in the browser to link to the data, giving a display that shows the
correct number of empty thumbnail frames but without the displayed
photos, no Spry effects, and no large photo display. I'm sure I
have multiple reference errors, but I don't see them. Any ideas?
Initial Photo Demo page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Copyright (c) 2006. Adobe Systems Incorporated. All
rights reserved. -->
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:spry="
http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
<title>Gallery</title>
<link rel="stylesheet" type="text/css"
href="../css/screen.css">
<script type="text/javascript"
src="../SpryAssets/xpath.js"></script>
<script type="text/javascript"
src="../SpryAssets/SpryData.js"></script>
<script type="text/javascript"
src="../SpryAssets/SpryEffects.js"></script>
<script type="text/javascript">
var dsGalleries = new
Spry.Data.XMLDataSet("galleries/galleries.xml",
"galleries/gallery");
var dsGallery = new
Spry.Data.XMLDataSet("galleries/{dsGalleries::@base}{dsGalleries::@file}",
"gallery");
var dsPhotos = new
Spry.Data.XMLDataSet("galleries/{dsGalleries::@base}{dsGalleries::@file}",
"gallery/photos/photo");
</script>
<script src="../SpryAssets/gallery.js"
type="text/javascript"></script>
</head>
<body id="gallery">
<noscript><h1>This page requires JavaScript.
Please enable JavaScript in your browser and reload this
page.</h1></noscript>
<div id="wrap">
<h1 id="albumName"
spry:region="dsGallery">{sitename}</h1>
<div id="previews">
<div id="galleries" spry:region="dsGalleries">
<label for="gallerySelect">View:</label>
<select spry:repeatchildren="dsGalleries"
id="gallerySelect"
onchange="dsGalleries.setCurrentRowNumber(this.selectedIndex);">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}"
selected="selected">{sitename}</option>
<option spry:if="{ds_RowNumber} !=
{ds_CurrentRowNumber}">{sitename}</option>
</select>
</div>
<div id="controls">
<ul id="transport">
<li><a href="#" onclick="StopSlideShow();
AdvanceToNextImage(true);"
title="Previous">Previous</a></li>
<li class="pausebtn"><a href="#" onclick="if
(gSlideShowOn) StopSlideShow(); else StartSlideShow();"
title="Play/Pause" id="playLabel">Play</a></li>
<li><a href="#" onclick="StopSlideShow();
AdvanceToNextImage();" title="Next">Next</a></li>
</ul>
</div>
<div id="thumbnails" spry:region="dsPhotos dsGalleries
dsGallery">
<div spry:repeat="dsPhotos"
onclick="HandleThumbnailClick('{ds_RowID}');"
onmouseover="GrowThumbnail(this.getElementsByTagName('img')[0],
'{@thumbwidth}', '{@thumbheight}');"
onmouseout="ShrinkThumbnail(this.getElementsByTagName('img')[0]);">
<img id="tn{ds_RowID}" alt="thumbnail for {@thumbpath}"
src="galleries/{dsGalleries::@base}{dsGallery::thumbnail/@base}{@thumbpath}"
width="24" height="24" style="left: 0px; right: 0px;" />
</div>
<p class="ClearAll"></p>
</div>
</div>
<div id="picture">
<div id="mainImageOutline" style="width: 0px; height:
0px;"><img id="mainImage" alt="main image" /></div>
</div>
<p class="clear"></p>
</div>
</body>
</html>
Fixed reference version:
<head>
var dsGalleries = new
Spry.Data.XMLDataSet("Graphics/galleries/galleries.xml",
"galleries/gallery");
var dsGallery = new
Spry.Data.XMLDataSet("Graphics/galleries/egypt/Egyptphotos.xml",
"gallery");
var dsPhotos = new
Spry.Data.XMLDataSet("Graphics/galleries/egypt/Egyptphotos.xml",
"gallery/photos/photo");
</script>
Supporting files galleries.xml and Egyptphotos.xml
<?xml version="1.0" encoding="UTF-8"?>
<galleries>
<gallery base="Graphics/galleries/egypt/"
file="Egyptphotos.xml">
<sitename>Egypt</sitename>
<photographer>Don Booth</photographer>
<contactinfo>
http://www.adobe.com</contactinfo>
<email>[email protected]</email>
<security><![CDATA[]]> </security>
</gallery>
... duplicate China and Paris declarations
</gallery>
</galleries>
<?xml version="1.0" encoding="UTF-8"?>
<gallery
base = ""
background = "#FFFFFF"
banner = "#F0F0F0"
text = "#000000"
link = "#0000FF"
alink = "#FF0000"
vlink = "#800080"
date = "1/10/2006">
<sitename>Egypt Gallery</sitename>
<photographer>Don Booth</photographer>
<contactinfo>
http://www.adobe.com</contactinfo>
<email>[email protected]</email>
<security><![CDATA[]]> </security>
<banner font = "Arial" fontsize = "3" color =
"#F0F0F0"> </banner>
<thumbnail base
="../../gallery/galleries/egypt/thumbnails/" font = "Arial"
fontsize = "4" color = "#F0F0F0" border = "0" rows = "3" col =
"5"> </thumbnail>
<large base ="../../gallery/galleries/egypt/images/" font
= "Arial" fontsize = "3" color = "#F0F0F0" border = "0">
</large>
<photos id = "images">
<photo
path = "egypt_01.jpg"
width = "350"
height = "262"
thumbpath = "egypt_01.jpg"
thumbwidth = "75"
thumbheight = "56">
</photo>
</photos>
</gallery>Please delete this posting. I've found the full original
information in the v1.6 pre-release information and will compare to
that baseline. -
Printing Form Fields only .. from Reader
I am a NEWBIE using Adobe Acrobat 8 Pro. It would be a lot easier if Reader & Pro had the same print options for printing formfields only .. but that's life.
I have created a form with interactive fields for input. However am having
difficulty having just the "form fields" only print to the preprinted form.
I have created a new button and found coding for the printparms ..
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.silent;
pp.printContent = pp.constants.printContents.formFieldsOnly;
pp.pageHandling = pp.constants.handling.none;
this.print(pp);
It's my first attempt at XML / Javascript coding and must be missing something because it's not working.
If anyone has "a sample" of complete code .. it would be really appreciated .. or a brief explaination might get me going.Also the "PrintParams" properties require version 6 or above of Acrobat/Reader.
One has to review the Acrobat JavaScript API for all sorts of version variations in the way Acrobat's JS object works. And the documention is not always correct. -
Help for a massive dreamweaver noob...
Hey guys hows it going!
Will probably be bothering you with questions that will to most of you guys seem quite stupid, sorry in advance, over the coming months...
So here is question number 1 which I cant quite figure out at the moment, well, its a two-part question...
1) When trying to create a blank HTML document, I insert two frames (left and right side) as well as a horizontal rule for my head of page, yet when I save the document (I click SAVE ALL and have tried other save variations) it doesn't save the frames when I re-load the page?
2) Also, me and my friend couldn't find information anywhere about how to make a custom RSS feed. By this I mean not linking the feed from another site, but kind of like facebook's home page... for example, users input information into our website and we display it back to users through a constant feed if this makes sense!!
Nice to meet you all and hope everybody is well:)
Thanks in advance..Hi
First welcome to the forum, please be sure to read the 'Announcements' on the forum home page, (general section, and if you have a problem using the forum - http://forums.adobe.com/community/general/forum_comments/faq.
1) When trying to create a blank HTML document, I insert two frames
(left and right side) as well as a horizontal rule for my head of page,
yet when I save the document (I click SAVE ALL and have tried other
save variations) it doesn't save the frames when I re-load the page?
Unless you have a very specific reason to use frames, don't. For tutorials on using dreamweaver see - http://www.adobe.com/devnet/dreamweaver.html.
2) Also, me and my friend couldn't find information anywhere about how
to make a custom RSS feed. By this I mean not linking the feed from
another site, but kind of like facebook's home page... for example,
users input information into our website and we display it back to users
through a constant feed if this makes sense!!
If you are just starting out with web development you may find you are, 'trying to run, before you can walk' as this will require a knowledge of database/server-side code/xml/javascript. But you can use a widget or an extension for dreamweaver to create an rss feed once you know how those techs work, (and can use them correctly) see - http://www.adobe.com/devnet/dreamweaver/articles/using_widget_browser.html, for using the adobe widget browser and http://www.adobe.com/cfusion/exchange/index.cfm?searchfield=rss+feed&search_exchange=3&sea rch_category=-1&search_license=&search_rating=&search_platform=0&search_pubdate=&num=25&st artnum=1&event=search&sticky=true&sort=0&rnav_dummy_tmpfield=&Submit=, for an extension.
PZ -
Web Developer Needed for a Hawaii Real Estate Agency
Web Developer Needed for a Hawaii Real Estate Agency
(Telecommuting OK. No Relocation)
We are an innovative, technology oriented, real estate agency
searching for an excellent web developer to continue to improve and
grow our 40 agents business. This is a full-time telecommuting
position (although we would love for you to physically be in our
office in Kailua-Kona, Hawaii, we do not pay for relocation
expenses)
The ideal candidate should possess the following skills:
Required skills:
* 5+ years experience in building web applications
* Mastery of ColdFusion MX 6/7 (at least 2 years working
intensively with Coldfusion)
* SQL Server 2000 - Building normalized and optimized
databases, Creating Data Transformation Service packages (DTS),
Import/Export Data, Stored Procedures
* Mastery of: XML, JavaScript, CSS, HTML, Dreamweaver (or
other IDE), Photoshop, some Flash
* Experience with Fusebox 4 methodology
* Excellent communication skills
* Salary commensurate with experience
Additional preferred skills:
* Goldmine 6.7 (a big plus)
* Crystal Reports (or equivalent reporting tool)
* Web (graphic) design skills
Primary Duties:
* Maintain and improve existing Coldfusion/Fusebox 4 web
applications
* Design and build new real estate related tools and
applications
* Create an application to process and consolidate multiple
MLS feeds in various formats into a single database.
* Integrate between websites and CRM system
* Create automation processes in various areas
* Administer Goldmine
* Write procedures and documentations
Interested candidates should email their resume to
[email protected] Only serious candidates please.Hi,
Is this still available? Current location Captain Cook -
S.Kona. 8 yrs CF/SQL etc.
Thanks -
[JS][CS5] question, and comments
HI All.
I must first start off by recommending anyone seriously wanting to get into Scripting, or (like me) am fairly knowledgable, but needed the resource, to check out "InDesign CS5 Automation Using XML & Javascript" by Grant Gamble. (Amazon, Kindle etc...)
I am sure I am not the only one who has made his way, stumbling and even hacking through code to produce scripts that work well, but not really understanding why certain things were done in a certain way. This books helps a great deal with this, laying a good basis for further development.
Anyway, on to my question. In the afore mentioned book, he talks about making a global variable/object that is used to pass variables into throughout the script ie:
var g = {};
main();
g = null;
function main(){
//code here
//g.win = new Window("dialog",undefined,"New Window");
//etc.....
I can see how this works, with "g" being a master item, but why would this be needed? It seems more confusing to me, but maybe cause I am self taught, and not really been shown the "proper" way to use variables!
Can someone explain the reason behind this for me.
Many Thanks
RoyHi, Roy:
I'm going to try again.
Don't fool yourself. A difference of opinion doesn't mean both sides are right. It could well mean one side is wrong. (Maybe that's me. Maybe that's Jongware. Let's wait and see what he has to say.)
In this case...this design pattern is just dumb. Unless there's something you're not showing us, like multiple functions that need to exchange data...in which case there is probably a better way, but it's hard to evaluate.
The pattern is dumb because it does bad things with no upside. It makes the code harder to read. It adds potential conflicts with other scripts. And it has no benefit.
I should probably have given you yet another example of something better. The very simple one. It's not as good because it still pollutes the namespace with main, but it's easy to understand and to read:
main();
function main() {
var g = {};
g.win = new Window("dialog", undefined, "New Window");
Even ignorance of a fnuction is probably better, since you could wrap it in a function later on (as your program got more complex) and it would all still work. That is:
var g = {};
g.win = new Window("dialog", undefined, "New Window");
But I suspect you're oversimplifying the program, since you told us that the point of this "technique" was to "pass variables into throughout the script."
But your example doesn't demonstrate any "passing." It's not too clear exactly what you mean though.
But here are some examples:
var g = {};
f1();
f2();
function f1() {
g.able = "baker";
function f2() {
alert(g.able);
There we have some data moving from f1() to f2(). But it's still poor. You should write it like this:
main();
function f1() { return "baker";
function f2(s) {
alert(s);
function main() {
var tmp;
tmp = f1();
f2(tmp);
But if for some reason it was really complicated and you needed to have f1() and f2() messing around directly with the data, then you could have a variable that was scoped to both of them:
function main() {
var shared;
function f1() {
shared = "baker";
function f2() {
alert(shared);
f1();
f2();
main();
But still you would never set a variable to null when you were done. The language has much better features than that! Use them!
When the enclosing function exits, there's never any fear of anything else gaining access to the variable. No need to set its value, because nothing can access it! Cross the final } and you're set. Awesome!
Obviously you put yourself at a level greater than someone needing
this book, but I know my short comings, and can see HUGE value in a book
detailing why certain practices are carried out
Respectfully, this is not a reasonable answer.
There are a lot of books out there. That you have found one that is better than forum posts does not mean it is a good idea to recommend it, especially when it seems to have problems. If you've read through several books and found this one to be better than the others, then that might be a good basis to recommend it. Or if you have searched high and low for books and failed to find any. Or if you were comparing it to Adobe's documentation on scripting. But by all means, do tell us the standard of comparison you're using...
But it doesn't sound like you're doing that. It sounds like you're in one breath praising a book, without comparing it to anything else. And in the next breath, you're asking a question (rightly so!) about what appears to be a bad practice that is advocated by the book.
That just doesn't make much sense.
I hope I'm misinterpretting you. -
Search feature with dreamweaver template
I'm building a site with products ids, I need to include a search feature that can find a specific product within the site. I found a template in Dreamweaver that includes the search form. How can I learn how to make it work? Is there any script out there for this? Thank you
Search is a server-side thing or something based on a pre-fab XML/ JavaScript that holds the indices and keywords. A input field named search in any form doesn't mean anything if the logic behind is missing. Depending on what you are looking for, something like this may get you started: http://www.wrensoft.com/zoom/. For more complex stuff, you will have to use PHP or other server languages or rely on Google...
Mylenium -
Hi, I see plenty of references in this forum to people scripting AME, but I can't find the promised doc for the AME-specific subset of Extend Script anywhere.
In the "Adobe Introduction to Scripting" pdf, in the section "More information about scripting", we are told:
"Each scripting language contains many more devices and techniques for adding power and complexity to
your scripts. To continue learning how to script your Adobe applications, please refer to the Adobe
scripting guide for your application."
Is there any such documentation?
If not, how do folk on this list work this out?
Many thanks
Peter@Jeff – don't know if there is a specific scripting guide for InDesign CC.
For news of new methods, properties and objects in the DOM (Document Object Model) in ExtendScript (Adobe's implementation of JavaScript) with InDesign see:
Marc Autret:
So What's New in InDesign CC Scripting DOM
http://www.indiscripts.com/post/2013/06/so-what-s-new-in-indesign-cc-scripting-dom
Another valuable reference (not covering CC but also InDesign CS6) is:
http://www.jongware.com/idjshelp.html
For learning ExtendScript you will find useful:
1. Learn about "core" JavaScript (there are plenty of useful courses floating around in the web)
2. Buy yourself a book like Grant Gamble's "InDesign CS5 – Automation Using XML & JavaScript"
and experiment with your own InDesign files and code snippets from that base on…
3. Find a collegue or some friends who also want to learn about it and do some learning sessions together
4. Visit this forum a lot and browse through older threads. Most threads are about ExtendScript.
Where did you hear that Adobe wants to phase out AppleScript on its products?
Flash based extensions and related to that "ActionScript" will be phased out next year for building Extensions for CC applications. It will be replaced with [HTML5, CSS and JavaScript] for building widgets. PhotoShop CC will be the first product where we will see this (maybe around mid 2014); others will follow.
Maybe you read about the abbreviation "AS" in this regard; which for some people is "AppleScript" and for some people it is "ActionScript". Don't confuse the two scripting languages.
Uwe
Maybe you are looking for
-
Hi i am just wondering why i cannot download my apps to my iphone
my labtop wont let me download apps to my i phone and when i click on it nothing happens it is just like it is frozen
-
Control of Text box in Dialog programming
Hai Friends i am having problem in controlling the Text box in PAI of Screen. For eg. if it is command button with the use of Function name i can able to check or do validation in PAI. As in the case of Textbox how to give the name for the text box a
-
Servlet executes only once, the first time???
Hello evrybody, I'll try to be specific regarding the problem. I have an HTML file called Login.html. When I click on this file, a page opens allowing the user to enter his/her username and password. So, I compiled my servlet and I clicked on the Log
-
File getting locked in RDC when saving it to redirected drive (from remoteapp).
Hello, when exporting excel file from our RemoteApp to my local C disk (\\tslcient\c) the file is getting locked and can not be used until I close the RemoteApp. If for example I try to delete file before closing RemoteApp, I get the error that file
-
Unable to post on instagram w/my iMac,how can I fix this?
How to fix problem on instagram,unaple to post anything?