Microsoft Content Management Server - how to check to see if xmlplaceholder has no data entry

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > August 2005 > how to check to see if xmlplaceholder has no data entry





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 check to see if xmlplaceholder has no data entry
andrew007

2005-08-24, 6:06 pm

Hi I try to check to see if xmlplaceholder has data in it or not when loading
control but It seems to have root element w/empty data so I can't tell w/the
following method.

Please let me know if you know how to test to see if there is data in a
xmlplaceholder or not. This is how I use it...

if (((XmlPlaceholder)ph).XmlAsString.Trim() == string.Empty)
noData = true;
else
noData = false;

note: when xmlastring returns "<plink></plink>" it is not string.Emtpy so my
result gonna be noData become false even though xmlplaceholder has no data
except for root element.




Stefan [MSFT]

2005-08-25, 2:52 am

Hi Andrew,

why don't you check for empty and only root element?

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"andrew007" <gahdhi@yahoo.com> wrote in message
news:6C8FF9F2-1345-494D-9B07-A7B94528595B@microsoft.com...
> Hi I try to check to see if xmlplaceholder has data in it or not when
> loading
> control but It seems to have root element w/empty data so I can't tell
> w/the
> following method.
>
> Please let me know if you know how to test to see if there is data in a
> xmlplaceholder or not. This is how I use it...
>
> if (((XmlPlaceholder)ph).XmlAsString.Trim() == string.Empty)
> noData = true;
> else
> noData = false;
>
> note: when xmlastring returns "<plink></plink>" it is not string.Emtpy so
> my
> result gonna be noData become false even though xmlplaceholder has no data
> except for root element.
>
>
>
>



andrew007

2005-08-25, 6:02 pm

The root element keeps changing for every time so ..can you show me the
sample code to achieve your suggestion?

"Stefan [MSFT]" wrote:

> Hi Andrew,
>
> why don't you check for empty and only root element?
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> ----------------------
>
>
> "andrew007" <gahdhi@yahoo.com> wrote in message
> news:6C8FF9F2-1345-494D-9B07-A7B94528595B@microsoft.com...
>
>
>

Stefan [MSFT]

2005-08-26, 7:53 am

Hi Andrew,

if it is sufficient to strip out all XML tags then you can use this code:
http://blogs.technet.com/stefan_gos.../12/407637.aspx

This will require that your regular XML content contains texts between the
markup.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"andrew007" <gahdhi@yahoo.com> wrote in message
news:ACDB3283-0572-4681-B7E4-2F9C09AEC7C5@microsoft.com...[vbcol=seagreen]
> The root element keeps changing for every time so ..can you show me the
> sample code to achieve your suggestion?
>
> "Stefan [MSFT]" wrote:
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com