|
Home > Archive > BizTalk Server Orchestration > April 2005 > How to pad a schema attribute
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to pad a schema attribute
|
|
|
| I wondered if anyone knew how to pad an attribute with leading spaces.
I am reading a Flat File that contains a string of variable length.
Example;
74823
82344832
I then need to send them to an oracle query that requires them to have a 16
characters. the padded characters must be on the left.
' 74823'
Do I have to write my own custom functoid or is there any built in thing to
do this.
Thanks for your help.
Ron
| |
|
| Hi,
When defining flatfile schemas (positional), you can define the positioning
of the field (left or right) and a padding character (spacing in your case).
That should resolve your issue. That way, you do not have to insert spaces
etc during mapping but the flatfile serializer takes care of that handling.
Sincerely
Joerg Fischer
"Ron J" <RonJ@discussions.microsoft.com> schrieb im Newsbeitrag
news:304D39CA-A8C3-45D1-B93E-F5D698CA9531@microsoft.com...
>I wondered if anyone knew how to pad an attribute with leading spaces.
> I am reading a Flat File that contains a string of variable length.
> Example;
> 74823
> 82344832
>
> I then need to send them to an oracle query that requires them to have a
> 16
> characters. the padded characters must be on the left.
>
> ' 74823'
>
> Do I have to write my own custom functoid or is there any built in thing
> to
> do this.
>
> Thanks for your help.
> Ron
>
>
>
| |
|
| Joerg,
thanks for your reply. It is a first for me to receive a reply so I
appreciate it.
I tried this already and it didn't work.
What I did is the following:
I created a schema in biztalk that is a flat file
Schema
Response
EItem
It is pretty simple. Just one item
The EItem has 8 characters
example:
12345678
I receive this in biztalk and it shows up like this
<...><EItem="12345678"></EItem>
On the EItem element field I set
Pad Character Type Hexadecimal
Pad Character 0x20 (I even tried a regular character just so I was sure it
wasn't getting rid of whitespace)
Justification Right
Minimum Length with Pad Character 16
I expected to get this
<EItem> 12345678</EItem>
but I didn't
Reading the documentation carefully makes me feel like this should work.
I then generated and instance of my schema and it outputs the data to a file
with leading blanks.
Unfortunately I am reading the data from a file that doesn't have blanks and
reading the schema in my orchestration and doing something with this number.
I resorted to creating a dll that pads the string and using it in an
expression.
I'll bet I am doing something wrong but I tried for about 5 hours all
different combinations. Maybe I am just stupid.
Thanks for your reply.
I appreciated it.
Ron
"Joerg Fischer" wrote:
> Hi,
>
> When defining flatfile schemas (positional), you can define the positioning
> of the field (left or right) and a padding character (spacing in your case).
> That should resolve your issue. That way, you do not have to insert spaces
> etc during mapping but the flatfile serializer takes care of that handling.
>
> Sincerely
>
> Joerg Fischer
>
> "Ron J" <RonJ@discussions.microsoft.com> schrieb im Newsbeitrag
> news:304D39CA-A8C3-45D1-B93E-F5D698CA9531@microsoft.com...
>
>
>
| |
|
| Hi Ron,
The justification is not considered by the serializer when serializing XML
Data. It is only relevant for serializing Flatfile structures. Thus, the
information can only be applied for flatfile schemas and is only processed
by the FF serializer.
Sincerely
Joerg Fischer
"Ron J" <RonJ@discussions.microsoft.com> schrieb im Newsbeitrag
news:24C91660-933F-479E-AB05-4B8E9C0AA578@microsoft.com...[vbcol=seagreen]
> Joerg,
> thanks for your reply. It is a first for me to receive a reply so I
> appreciate it.
> I tried this already and it didn't work.
> What I did is the following:
>
> I created a schema in biztalk that is a flat file
>
> Schema
> Response
> EItem
>
> It is pretty simple. Just one item
>
> The EItem has 8 characters
>
> example:
> 12345678
>
> I receive this in biztalk and it shows up like this
>
> <...><EItem="12345678"></EItem>
>
> On the EItem element field I set
> Pad Character Type Hexadecimal
> Pad Character 0x20 (I even tried a regular character just so I was sure it
> wasn't getting rid of whitespace)
> Justification Right
> Minimum Length with Pad Character 16
>
> I expected to get this
> <EItem> 12345678</EItem>
>
> but I didn't
>
> Reading the documentation carefully makes me feel like this should work.
> I then generated and instance of my schema and it outputs the data to a
> file
> with leading blanks.
>
> Unfortunately I am reading the data from a file that doesn't have blanks
> and
> reading the schema in my orchestration and doing something with this
> number.
> I resorted to creating a dll that pads the string and using it in an
> expression.
>
> I'll bet I am doing something wrong but I tried for about 5 hours all
> different combinations. Maybe I am just stupid.
>
> Thanks for your reply.
> I appreciated it.
> Ron
>
>
>
>
>
>
>
> "Joerg Fischer" wrote:
>
|
|
|
|
|