Author |
Message
|
oomran |
Posted: Fri Feb 23, 2007 1:42 pm Post subject: external Files |
|
|
Novice
Joined: 19 Feb 2007 Posts: 16
|
how to read value from an external file using esql only (Compute node), without java or any plug in. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Feb 23, 2007 6:27 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
oomran |
Posted: Sat Feb 24, 2007 6:33 am Post subject: |
|
|
Novice
Joined: 19 Feb 2007 Posts: 16
|
I tried to use external entities in XML
so I get the input message
i/p
<msg>
<CustomerName>xyz</CustomerName>
<CustomerMail>xyz</CustomerMail>
<CustomerAddress>xyz</CustomerAddress>
</msg>
and in the compute node I added a password tag with its value from an external file
but I got the output as the following
o/p
<doc type declaration to assigne the extent external entity to the file>
<msg>
<CustomerName>xyz</CustomerName>
<CustomerMail>xyz</CustomerMail>
<CustomerAddress>xyz</CustomerAddress>
<password>&extent;</password>
</msg>
when I copy the output to an XML file it read the password content from the file.
but I want the value to be extracted in the output queue |
|
Back to top |
|
 |
elvis_gn |
Posted: Sat Feb 24, 2007 6:51 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi oomran,
oomran wrote: |
and in the compute node I added a password tag with its value from an external file |
How did you read the file from a compute node ?
oomran wrote: |
when I copy the output to an XML file it read the password content from the file.
but I want the value to be extracted in the output queue |
How are u copying the XML to a file ?
Can you please paste your ESQL code. How did you get this
oomran wrote: |
<doc type declaration to assigne the extent external entity to the file> |
It is not possible to read an external file from a compute unless you are using a java function there or something....
Regards. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Feb 24, 2007 9:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can not do this from ESQL.
The XMLNSC parser will not read external files when serializing or unserializing an XML message tree.
I repeat.
You can not do this from ESQL.
You can read data from Databases using ESQL. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
oomran |
Posted: Sat Feb 24, 2007 12:56 pm Post subject: |
|
|
Novice
Joined: 19 Feb 2007 Posts: 16
|
Here is My Try
Code: |
set OutputRoot = InputRoot
SET OutputRoot.XML.(XML.DocTypeDecl).(XML.IntSubset).
(XML.ExternalEntityDecl)extent2 = '';
SET OutputRoot.XML.(XML.DocTypeDecl).(XML.IntSubset).
(XML.ExternalEntityDecl)extent2.(XML.SystemId)
= 'more.txt';
Set OutputRoot.XML.(XML.Element)CustomerPasswrod.(XML.AsisElementContent) = '&extent2;' |
now the output is :
Code: |
<msg>
<CustomerName>xyz</CustomerName>
<CustomerMail>xyz</CustomerMail>
<CustomerAddress>xyz</CustomerAddress>
<password>&extent2;</password>
</msg> |
when I copy the output to an xml File the XML parser in the browser extract the extent2 value from the file more.txt
but when I try in another node to get the customerpassword value I get &extent2;
the Broker XML parser doesn't extract the exernal entity.
I know that reading from files in the esql is not possible but I try to get around that. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Feb 24, 2007 1:40 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes, please continue to try things.
I'm sure eventually you will have tried everything you can possibly try.
And then you will have proven for yourself what you have already been told.
You can't do this in ESQL.
You can't do this with the XML parsers.
You can only read data from files in a Java Compute node, a Java custom-plugin, or a C custom plugin. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|