12-02-2009 08:51 AM - edited 03-14-2019 04:56 AM
Hello all,
I am trying to use the DOC variable to do a GET XML. In my GET XML I specify a variable for the Document field.
In the DOC variable I want to use the value such that DOC[variable + "filename.xml"] where variable is a directory specified as "Files\".
When I debug the script it cannot complete the GET XML step because it can't find the file at location "Files\filename.xml". What am I doing wrong?
Thanks,
12-02-2009 11:48 AM
The document repository uses a forward slash for starters: DOC[Files/filename.xml]
Besides that, ensure that you are specifying this in the Source Document parameter.
12-03-2009 07:48 AM
I couldn't get this to work.
So I tried this instead:
Create File Document Filename=filedir + "\" + filename | Document = xmlMotd (filedir and filename are string variables)
Create XML Document Source Document=xmlMotd | Document=xmlMotdDoc
Get XML Document Date Document=xmlMotdDoc | XML Path:"a valid xml file on the server" | Result Data=xmlMotdGet
When I run the debug the xmlMotd variable gets the right path to the file \de_DE\IT\motd.xml (the actual location of the file on the server is c:\program files\wfavvid\Documents\user\de_DE\IT\motd.xml. However, the script fails and the debug tells me "the system cannot find the path specified".
Am I using the right approach to find and read an xml file on the server whose name and location are build up using script vaiables or must I always hard code the location of the file in the script?
Thanks,
12-03-2009 10:07 AM
The first thing that stands out to me is that you should not be referencing the local file system or using the Create File Document step. Your XML file needs to be in the Document Repository which you upload through /appadmin. This is synchronized to the disk from the database automatically for you.
The Create XML Document step has three parameters. They should look something like this:
Source Document: DOC[xmlDocumentsUrl + xmlFilename]
Where xmlDocumentsUrl would be the folder within the document repository and xmlFilename is the actual file.
When the engine processes this, it will look something like this DOC[example\filename.xml]. Remember that this is inside the default language unless you qualify it with a language qualifier: DOC[example\filename.xml] @ L[de_DE]
Source ID:
Document: YOURDOCVARIABLE
This should be a Document type variable.
The parameters for your Get XML Document Data steps should look something like this:
Document YOURDOCVARAIBLE
XML Path: "/example_root/next/etc"
Xpath is very flexible. You should look at the W3C or W3Schools references for additional information.
Result Data: YOURSTRINGVARIABLE
Where you want the result stored.
12-03-2009 05:05 PM
upload your script we can see more cleary. are you really calling file name as filename? You are in the direction except few small checks like forward slash etc. Do you have all the steps required like create file document, create xml and then get xml.....
F1- Help and few scripts are helpful as well.
12-11-2009 02:41 AM
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: