Author |
Message
|
seeknee |
Posted: Tue Feb 10, 2004 7:18 am Post subject: |
|
|
 Apprentice
Joined: 08 Aug 2002 Posts: 41 Location: Melbourne, Australia
|
Hi
Not to sure if this sound obvious but have you tried
SET OutputRoot = InputRoot;
SET OutputRoot.XML.INMSG.APPERROR.ERROR = '123456';
SET OutputRoot.XML.INMSG.APPERROR.ERRORDESC = Description
SET OutputRoot.XML.INMSG.APPERROR.ERRORTIME = Timestamp
This should append your XML.
Hopefully this helps
 |
|
Back to top |
|
 |
seeknee |
Posted: Tue Feb 10, 2004 8:04 am Post subject: |
|
|
 Apprentice
Joined: 08 Aug 2002 Posts: 41 Location: Melbourne, Australia
|
Hi again
Try something like this
SET OutputRoot = InputRoot;
SET OutputRoot.XML.INMSG.APPERROR.ERROR = '123456';
SET OutputRoot.XML.INMSG.APPERROR.ERRORDESC = Description
SET OutputRoot.XML.INMSG.APPERROR.ERRORTIME = Timestamp
DECLARE myref REFERENCE TO OutputRoot.XML.INMSG.APPERROR;
DETACH myref;
ATTACH myref TO OutputRoot.XML.TPCIData AS LASTCHILD; |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Feb 10, 2004 8:07 am Post subject: Re: Create next sibling query |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ssk wrote: |
When I use the following code:
SET OutputRoot = InputRoot;
DECLARE InRef REFERENCE TO OutputRoot.XML.INMSG;
CREATE NEXTSIBLING OF InRef NAME 'APPERROR';
I get the following error message logged: 'The Element APPERROR has an invalid element type for a top level element'.
What am I doing wrong? How can I solve this problem? |
Well, by trying to create the next sibling of your Root element, you're trying to create a second XML document root. Which isn't a good idea.
You probably want to create the Last Child, rather than the Next Sibling. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Missam |
Posted: Tue Feb 10, 2004 10:25 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
why don't you try this
SET OutputRoot = InputRoot;
DECLARE InRef REFERENCE TO OutputRoot.XML.INMSG;
CREATE LASTCHILD OF InRef Name 'APPERROR';
MOVE InRef TO InRef.APPERROR;
CREATE LASTCHILD OF InRef Name 'ERRORSOURCE' VALUE 'Error Flow';
CREATE LASTCHILD OF InRef Name 'ERROR' VALUE 'ErrorChar';
CREATE LASTCHILD OF InRef NAME 'ERRORDESC' VALUE 'ErrorText';
CREATE LASTCHILD OF InRef NAME 'ERRORNODE' VALUE 'ErrorNode'; |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Feb 10, 2004 10:36 am Post subject: Re: Nextsibling |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ssk wrote: |
Basically, the problem is that it makes APPDATA a child of APPERROR. |
Where is the code that creates APPDATA? You did not list it.
Also, you do not need to be using CREATE LASTCHILD for everything. You can do the CREATE LASTCHILD to create APPERROR in the correct place, and then do
Code: |
set OutputRoot.XML.INMSG.APPERROR.ERRORSOURCE= 'Error Flow' |
and etc. once you've properly established where APPEROR belongs. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|