XmlSerializer Collection with Collections

Hello I got this working but it is not how I really want it, basically
I have an xml file which has a root of <test> and can be filled with 3
different types of <question> elements with different attributes, all
share a base set of 4, one of the question types can have children
with <option> elements, this is how the xml looks after
serialization....

If you notice there is an extra <SelectionList> around the <option>'s
in the
final <question>, how can I write my class so I don't have this extra
<SelectionList> element....my class follows, you can see in the 2nd
public Question constructor is where I add the OptionList type....any
ideas, I know that really there is nothing wrong with having an extra
<SelectionList> element around the <option> elements but I really want
to know if my class is properly constucted.


<?xml version="1.0" encoding="utf-8"?>
<Test xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Question text="What is love?" type="Input" score="3"
mandatory="false" multiLine="false" maxlength="0" minlength="0"
validate="None" />
  <Question text="This is better than sliced bread?" type="Input"
score="9" mandatory="false" multiLine="false" maxlength="0"
minlength="0" validate="None" />
  <Question text="input question" type="Input" score="8"
mandatory="true" multiLine="true" maxlength="7" minlength="1"
initialvalue="hello" validate="Currency" answer="this is the answer"
/>
  <Question text="What is square root of 2?" type="selection"
score="3" mandatory="false" multiLine="false" maxlength="0"
minlength="0" validate="None">
    <SelectionList>
      <Option text="first" selected="true" tooltip="hovertext"
answer="false" />
      <Option text="second" selected="true" tooltip="hovertext"
answer="true" />
    </SelectionList>
  </Question>
</Test>

using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Serialization;

namespace TestCreator
{
	public class TestSerializer
	{
		public TestSerializer()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		
		//test class which will be serialized
		[XmlRoot("Test")]
		public class QuestionList 
		{
			private ArrayList listQuestions;

			public QuestionList() 
			{
				listQuestions = new ArrayList();
			}

			[XmlElement("Question")]
			public Question[] Questions 
			{
				get 
				{
					Question[] questions = new Question[ listQuestions.Count ];
					listQuestions.CopyTo( questions );
					return questions;
				}
				set 
				{
					if( value == null ) return;
					Question[] questions = (Question[])value;
					listQuestions.Clear();
					foreach( Question question in questions )
						listQuestions.Add( question );
				}
			}

			public int AddQuestion( Question question ) 
			{
				return listQuestions.Add( question );
			}
		}
	
		public class OptionList
		{
			private ArrayList listOptions;
				
			public OptionList() 
			{
				listOptions = new ArrayList();
			}
			[XmlElement("Option")]
			public Option[] Options 
			{
				get 
				{
					Option[] options = new Option[ listOptions.Count ];
					listOptions.CopyTo( options );
					return options;
				}
				set 
				{
					if( value == null ) return;
					Option[] options = (Option[])value;
					listOptions.Clear();
					foreach( Option option in options )
						listOptions.Add( option );
				}
			}
			public int AddOption( Option option ) 
			{
				return listOptions.Add( option );
			}
		}

		public class Question
		{
			[XmlAttribute("text")] public string questionText;
			[XmlAttribute("type")] public string type;
			[XmlAttribute("score")] public int score;
			[XmlAttribute("mandatory")] public bool mandatory;
			[XmlAttribute("multiLine")] public bool multiline;
			[XmlAttribute("maxlength")] public int maxlength;
			[XmlAttribute("minlength")] public int minlength;
			[XmlAttribute("initialvalue")] public string initialvalue;
			[XmlAttribute("validate")] public Validation validate;
			[XmlAttribute("answer")] public string answer;
			[XmlElement("SelectionList")] public OptionList optionlist;
			//[XmlElement("go")] public ArrayList optionlist;
			
			public enum Validation
			{
				None,
				Date,
				Integer,
				Currency
			}
			public Question() 
			{
			}

			public Question( string QuestionText, string Type, int Score, bool
Mandatory, OptionList opl )
			{
				questionText = QuestionText;
				type = Type;
				score = Score;
				mandatory = Mandatory;
				optionlist = opl;
			}

			public Question( string QuestionText, string Type, int Score, bool
Mandatory, bool MultiLine, int MaxLength, int MinLength, string
InitialValue, Validation Validate, string Answer)
			{
				questionText = QuestionText;
				type = Type;
				score = Score;
				mandatory = Mandatory;
				multiline = MultiLine;
				maxlength = MaxLength;
				minlength = MinLength;
				initialvalue = InitialValue;
				validate = Validate;
				answer = Answer;
			}
		}
		
		public class Option
		{
			[XmlAttribute("text")] public string label;
			[XmlAttribute("selected")] public bool selected;
			[XmlAttribute("tooltip")] public string tooltip;
			[XmlAttribute("answer")] public bool answer;
						
			public Option()
			{
			}

			public Option( string Label, bool Selected, string Tooltip, bool
Answer )
			{
				label = Label;
				selected = Selected;
				tooltip = Tooltip;
				answer = Answer;
			}
		}

		public static void Serialize(QuestionList myList)
		{
			XmlSerializer s = new XmlSerializer( typeof( QuestionList ) );
			TextWriter w = new StreamWriter( @"c:\list.xml" );
			s.Serialize( w, myList );
			w.Close();
		}
	}
}

To test do this:
TestSerializer.QuestionList myList = new
TestSerializer.QuestionList();
myList.AddQuestion( new TestSerializer.Question("What is
love?","Input",3,false ) );

TestSerializer.OptionList opl = new TestSerializer.OptionList();
opl.AddOption( new TestSerializer.Option("first",true,"hovertext",false));
opl.AddOption( new TestSerializer.Option("second",true,"hovertext",true));
myList.AddQuestion( new TestSerializer.Question("What is the square
root of 2?","selection",3,false,opl ) );
TestSerializer.Serialize(myList);
0
yurps (7)
6/29/2004 3:56:26 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
1220 Views

Similar Articles

[PageSpeed] 41

What you can do here is hide the OptionList from serialization as follows:

          [XmlIgnore] public OptionList optionlist;

Then add a property that exposes the nested Option[] array:

           [XmlElement("Option")]
            public Option[] Options {
                get {
                    return optionlist.Options;
                }
                set {
                    optionlist.Options = value;
                }
            }

Note: Make sure you always test that you can round trip your XML by
serializing, then deserializing the result, then you can serialize again and
windiff the two serialized outputs.  They should be identical.  I also find
it handy to put the Seralize helper methods on the class being serialized,
in this case the QuestionList class, so they end up looking like this:

             public void Serialize(string filename) {
                XmlSerializer s = new XmlSerializer( typeof(
QuestionList ) );
                XmlTextWriter w = new XmlTextWriter(filename,
System.Text.Encoding.UTF8);
                w.Formatting = Formatting.Indented;
                s.Serialize( w, this );
                w.Close();
            }

            public static QuestionList Deserialize(string filename) {
                XmlSerializer s = new XmlSerializer( typeof(
QuestionList ) );
                XmlTextReader r = new XmlTextReader(filename);
                QuestionList result = (QuestionList)s.Deserialize(r);
                r.Close();
                return result;
            }



"magister" <yurps@yahoo.co.uk> wrote in message
news:984bebc3.0406290756.3e141a44@posting.google.com...
> Hello I got this working but it is not how I really want it, basically
> I have an xml file which has a root of <test> and can be filled with 3
> different types of <question> elements with different attributes, all
> share a base set of 4, one of the question types can have children
> with <option> elements, this is how the xml looks after
> serialization....
>
> If you notice there is an extra <SelectionList> around the <option>'s
> in the
> final <question>, how can I write my class so I don't have this extra
> <SelectionList> element....my class follows, you can see in the 2nd
> public Question constructor is where I add the OptionList type....any
> ideas, I know that really there is nothing wrong with having an extra
> <SelectionList> element around the <option> elements but I really want
> to know if my class is properly constucted.
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <Test xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>   <Question text="What is love?" type="Input" score="3"
> mandatory="false" multiLine="false" maxlength="0" minlength="0"
> validate="None" />
>   <Question text="This is better than sliced bread?" type="Input"
> score="9" mandatory="false" multiLine="false" maxlength="0"
> minlength="0" validate="None" />
>   <Question text="input question" type="Input" score="8"
> mandatory="true" multiLine="true" maxlength="7" minlength="1"
> initialvalue="hello" validate="Currency" answer="this is the answer"
> />
>   <Question text="What is square root of 2?" type="selection"
> score="3" mandatory="false" multiLine="false" maxlength="0"
> minlength="0" validate="None">
>     <SelectionList>
>       <Option text="first" selected="true" tooltip="hovertext"
> answer="false" />
>       <Option text="second" selected="true" tooltip="hovertext"
> answer="true" />
>     </SelectionList>
>   </Question>
> </Test>
>
> using System;
> using System.Collections;
> using System.IO;
> using System.Xml;
> using System.Xml.Serialization;
>
> namespace TestCreator
> {
> public class TestSerializer
> {
> public TestSerializer()
> {
> //
> // TODO: Add constructor logic here
> //
> }
>
> //test class which will be serialized
> [XmlRoot("Test")]
> public class QuestionList
> {
> private ArrayList listQuestions;
>
> public QuestionList()
> {
> listQuestions = new ArrayList();
> }
>
> [XmlElement("Question")]
> public Question[] Questions
> {
> get
> {
> Question[] questions = new Question[ listQuestions.Count ];
> listQuestions.CopyTo( questions );
> return questions;
> }
> set
> {
> if( value == null ) return;
> Question[] questions = (Question[])value;
> listQuestions.Clear();
> foreach( Question question in questions )
> listQuestions.Add( question );
> }
> }
>
> public int AddQuestion( Question question )
> {
> return listQuestions.Add( question );
> }
> }
>
> public class OptionList
> {
> private ArrayList listOptions;
>
> public OptionList()
> {
> listOptions = new ArrayList();
> }
> [XmlElement("Option")]
> public Option[] Options
> {
> get
> {
> Option[] options = new Option[ listOptions.Count ];
> listOptions.CopyTo( options );
> return options;
> }
> set
> {
> if( value == null ) return;
> Option[] options = (Option[])value;
> listOptions.Clear();
> foreach( Option option in options )
> listOptions.Add( option );
> }
> }
> public int AddOption( Option option )
> {
> return listOptions.Add( option );
> }
> }
>
> public class Question
> {
> [XmlAttribute("text")] public string questionText;
> [XmlAttribute("type")] public string type;
> [XmlAttribute("score")] public int score;
> [XmlAttribute("mandatory")] public bool mandatory;
> [XmlAttribute("multiLine")] public bool multiline;
> [XmlAttribute("maxlength")] public int maxlength;
> [XmlAttribute("minlength")] public int minlength;
> [XmlAttribute("initialvalue")] public string initialvalue;
> [XmlAttribute("validate")] public Validation validate;
> [XmlAttribute("answer")] public string answer;
> [XmlElement("SelectionList")] public OptionList optionlist;
> //[XmlElement("go")] public ArrayList optionlist;
>
> public enum Validation
> {
> None,
> Date,
> Integer,
> Currency
> }
> public Question()
> {
> }
>
> public Question( string QuestionText, string Type, int Score, bool
> Mandatory, OptionList opl )
> {
> questionText = QuestionText;
> type = Type;
> score = Score;
> mandatory = Mandatory;
> optionlist = opl;
> }
>
> public Question( string QuestionText, string Type, int Score, bool
> Mandatory, bool MultiLine, int MaxLength, int MinLength, string
> InitialValue, Validation Validate, string Answer)
> {
> questionText = QuestionText;
> type = Type;
> score = Score;
> mandatory = Mandatory;
> multiline = MultiLine;
> maxlength = MaxLength;
> minlength = MinLength;
> initialvalue = InitialValue;
> validate = Validate;
> answer = Answer;
> }
> }
>
> public class Option
> {
> [XmlAttribute("text")] public string label;
> [XmlAttribute("selected")] public bool selected;
> [XmlAttribute("tooltip")] public string tooltip;
> [XmlAttribute("answer")] public bool answer;
>
> public Option()
> {
> }
>
> public Option( string Label, bool Selected, string Tooltip, bool
> Answer )
> {
> label = Label;
> selected = Selected;
> tooltip = Tooltip;
> answer = Answer;
> }
> }
>
> public static void Serialize(QuestionList myList)
> {
> XmlSerializer s = new XmlSerializer( typeof( QuestionList ) );
> TextWriter w = new StreamWriter( @"c:\list.xml" );
> s.Serialize( w, myList );
> w.Close();
> }
> }
> }
>
> To test do this:
> TestSerializer.QuestionList myList = new
> TestSerializer.QuestionList();
> myList.AddQuestion( new TestSerializer.Question("What is
> love?","Input",3,false ) );
>
> TestSerializer.OptionList opl = new TestSerializer.OptionList();
> opl.AddOption( new TestSerializer.Option("first",true,"hovertext",false));
> opl.AddOption( new TestSerializer.Option("second",true,"hovertext",true));
> myList.AddQuestion( new TestSerializer.Question("What is the square
> root of 2?","selection",3,false,opl ) );
> TestSerializer.Serialize(myList);


0
Chris
6/30/2004 8:05:04 AM
First, Thanks for your reply!

When I add [XmlIgnore] public OptionList optionlist
I then don't see any of the options that would normally
appear as children of the <optionlist>

As you can see I already have [XmlElement("Option")] above
my Option array....

Perhaps you mean I must move my Option array out of the OptionList
class...

Any further ideas or suggestions much appreciated...thanks!


"Chris Lovett" <chris@!nospam!.net> wrote in message news:<10e4t16n4455451@corp.supernews.com>...
> What you can do here is hide the OptionList from serialization as follows:
> 
>           [XmlIgnore] public OptionList optionlist;
> 
> Then add a property that exposes the nested Option[] array:
> 
>            [XmlElement("Option")]
>             public Option[] Options {
>                 get {
>                     return optionlist.Options;
>                 }
>                 set {
>                     optionlist.Options = value;
>                 }
>             }
> 
> Note: Make sure you always test that you can round trip your XML by
> serializing, then deserializing the result, then you can serialize again and
> windiff the two serialized outputs.  They should be identical.  I also find
> it handy to put the Seralize helper methods on the class being serialized,
> in this case the QuestionList class, so they end up looking like this:
> 
>              public void Serialize(string filename) {
>                 XmlSerializer s = new XmlSerializer( typeof(
> QuestionList ) );
>                 XmlTextWriter w = new XmlTextWriter(filename,
> System.Text.Encoding.UTF8);
>                 w.Formatting = Formatting.Indented;
>                 s.Serialize( w, this );
>                 w.Close();
>             }
> 
>             public static QuestionList Deserialize(string filename) {
>                 XmlSerializer s = new XmlSerializer( typeof(
> QuestionList ) );
>                 XmlTextReader r = new XmlTextReader(filename);
>                 QuestionList result = (QuestionList)s.Deserialize(r);
>                 r.Close();
>                 return result;
>             }
> 
> 
> 
> "magister" <yurps@yahoo.co.uk> wrote in message
> news:984bebc3.0406290756.3e141a44@posting.google.com...
> > Hello I got this working but it is not how I really want it, basically
> > I have an xml file which has a root of <test> and can be filled with 3
> > different types of <question> elements with different attributes, all
> > share a base set of 4, one of the question types can have children
> > with <option> elements, this is how the xml looks after
> > serialization....
> >
> > If you notice there is an extra <SelectionList> around the <option>'s
> > in the
> > final <question>, how can I write my class so I don't have this extra
> > <SelectionList> element....my class follows, you can see in the 2nd
> > public Question constructor is where I add the OptionList type....any
> > ideas, I know that really there is nothing wrong with having an extra
> > <SelectionList> element around the <option> elements but I really want
> > to know if my class is properly constucted.
> >
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <Test xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >   <Question text="What is love?" type="Input" score="3"
> > mandatory="false" multiLine="false" maxlength="0" minlength="0"
> > validate="None" />
> >   <Question text="This is better than sliced bread?" type="Input"
> > score="9" mandatory="false" multiLine="false" maxlength="0"
> > minlength="0" validate="None" />
> >   <Question text="input question" type="Input" score="8"
> > mandatory="true" multiLine="true" maxlength="7" minlength="1"
> > initialvalue="hello" validate="Currency" answer="this is the answer"
> > />
> >   <Question text="What is square root of 2?" type="selection"
> > score="3" mandatory="false" multiLine="false" maxlength="0"
> > minlength="0" validate="None">
> >     <SelectionList>
> >       <Option text="first" selected="true" tooltip="hovertext"
> > answer="false" />
> >       <Option text="second" selected="true" tooltip="hovertext"
> > answer="true" />
> >     </SelectionList>
> >   </Question>
> > </Test>
> >
> > using System;
> > using System.Collections;
> > using System.IO;
> > using System.Xml;
> > using System.Xml.Serialization;
> >
> > namespace TestCreator
> > {
> > public class TestSerializer
> > {
> > public TestSerializer()
> > {
> > //
> > // TODO: Add constructor logic here
> > //
> > }
> >
> > //test class which will be serialized
> > [XmlRoot("Test")]
> > public class QuestionList
> > {
> > private ArrayList listQuestions;
> >
> > public QuestionList()
> > {
> > listQuestions = new ArrayList();
> > }
> >
> > [XmlElement("Question")]
> > public Question[] Questions
> > {
> > get
> > {
> > Question[] questions = new Question[ listQuestions.Count ];
> > listQuestions.CopyTo( questions );
> > return questions;
> > }
> > set
> > {
> > if( value == null ) return;
> > Question[] questions = (Question[])value;
> > listQuestions.Clear();
> > foreach( Question question in questions )
> > listQuestions.Add( question );
> > }
> > }
> >
> > public int AddQuestion( Question question )
> > {
> > return listQuestions.Add( question );
> > }
> > }
> >
> > public class OptionList
> > {
> > private ArrayList listOptions;
> >
> > public OptionList()
> > {
> > listOptions = new ArrayList();
> > }
> > [XmlElement("Option")]
> > public Option[] Options
> > {
> > get
> > {
> > Option[] options = new Option[ listOptions.Count ];
> > listOptions.CopyTo( options );
> > return options;
> > }
> > set
> > {
> > if( value == null ) return;
> > Option[] options = (Option[])value;
> > listOptions.Clear();
> > foreach( Option option in options )
> > listOptions.Add( option );
> > }
> > }
> > public int AddOption( Option option )
> > {
> > return listOptions.Add( option );
> > }
> > }
> >
> > public class Question
> > {
> > [XmlAttribute("text")] public string questionText;
> > [XmlAttribute("type")] public string type;
> > [XmlAttribute("score")] public int score;
> > [XmlAttribute("mandatory")] public bool mandatory;
> > [XmlAttribute("multiLine")] public bool multiline;
> > [XmlAttribute("maxlength")] public int maxlength;
> > [XmlAttribute("minlength")] public int minlength;
> > [XmlAttribute("initialvalue")] public string initialvalue;
> > [XmlAttribute("validate")] public Validation validate;
> > [XmlAttribute("answer")] public string answer;
> > [XmlElement("SelectionList")] public OptionList optionlist;
> > //[XmlElement("go")] public ArrayList optionlist;
> >
> > public enum Validation
> > {
> > None,
> > Date,
> > Integer,
> > Currency
> > }
> > public Question()
> > {
> > }
> >
> > public Question( string QuestionText, string Type, int Score, bool
> > Mandatory, OptionList opl )
> > {
> > questionText = QuestionText;
> > type = Type;
> > score = Score;
> > mandatory = Mandatory;
> > optionlist = opl;
> > }
> >
> > public Question( string QuestionText, string Type, int Score, bool
> > Mandatory, bool MultiLine, int MaxLength, int MinLength, string
> > InitialValue, Validation Validate, string Answer)
> > {
> > questionText = QuestionText;
> > type = Type;
> > score = Score;
> > mandatory = Mandatory;
> > multiline = MultiLine;
> > maxlength = MaxLength;
> > minlength = MinLength;
> > initialvalue = InitialValue;
> > validate = Validate;
> > answer = Answer;
> > }
> > }
> >
> > public class Option
> > {
> > [XmlAttribute("text")] public string label;
> > [XmlAttribute("selected")] public bool selected;
> > [XmlAttribute("tooltip")] public string tooltip;
> > [XmlAttribute("answer")] public bool answer;
> >
> > public Option()
> > {
> > }
> >
> > public Option( string Label, bool Selected, string Tooltip, bool
> > Answer )
> > {
> > label = Label;
> > selected = Selected;
> > tooltip = Tooltip;
> > answer = Answer;
> > }
> > }
> >
> > public static void Serialize(QuestionList myList)
> > {
> > XmlSerializer s = new XmlSerializer( typeof( QuestionList ) );
> > TextWriter w = new StreamWriter( @"c:\list.xml" );
> > s.Serialize( w, myList );
> > w.Close();
> > }
> > }
> > }
> >
> > To test do this:
> > TestSerializer.QuestionList myList = new
> > TestSerializer.QuestionList();
> > myList.AddQuestion( new TestSerializer.Question("What is
> > love?","Input",3,false ) );
> >
> > TestSerializer.OptionList opl = new TestSerializer.OptionList();
> > opl.AddOption( new TestSerializer.Option("first",true,"hovertext",false));
> > opl.AddOption( new TestSerializer.Option("second",true,"hovertext",true));
> > myList.AddQuestion( new TestSerializer.Question("What is the square
> > root of 2?","selection",3,false,opl ) );
> > TestSerializer.Serialize(myList);
0
yurps (7)
7/1/2004 10:52:10 AM
Reply:

Similar Artilces:

XmlSerializer Collection with Collections
Hello I got this working but it is not how I really want it, basically I have an xml file which has a root of <test> and can be filled with 3 different types of <question> elements with different attributes, all share a base set of 4, one of the question types can have children with <option> elements, this is how the xml looks after serialization.... If you notice there is an extra <SelectionList> around the <option>'s in the final <question>, how can I write my class so I don't have this extra <SelectionList> element....my class follows, you ...

XmlSerializer
I'm having a basic problem with the XmlSerializer & i'm at my wits end trying to sort it out i have a basic clas <Serializable()> Class Tes Public Name as Strin End Clas when this serializes i wan <Test><Name>Value</Name></Test the problem is if i use the XmlSerializer clas Dim t as Tes t.Name="Value Dim sb As New StringBuilde Dim sw As New StringWriter(sb Dim Serializer As New XmlSerializer(Message.GetType Serializer.Serialize(sw, t Serializer = Nothin Console.Write(sb.ToStr...

XmlSerializer and shared objects (or How to generate IDREFs using XmlSerializer)
This is a multi-part message in MIME format. ------=_NextPart_000_007F_01C34AC1.11D4FB20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am trying to find a solution that will allow me to use XmlSerializer = to serialize/deserialize a collection of objects where a given object is = shared between two or more other objects, and not create duplicate XML = representations of the shared object, but instead use IDREFs to refer to = the shared object. The XML I'm trying to produce is as follows (where "href" is an IDREF): <...

Collecting data through email using VBA
Hi, I know that the "Create Email" tool in order to collect data through email but I want to do it automatically. My database form includes VBA code in order to send automate emails. I'd like to make this email "special" in order to receive the replay into access and use the answer email. I'd be grateful if someone could help me with the VBA code. Thanks! This capability is included in Access 2007, if you are using the .accdb file format, although you still need to initiate the process (ie. it is not fully automatic). What version of Access are you using? ...

XmlSerializer and inherited objects
Hi I have a hirachy of classes which are Message(base), then FileMessage and ChatMessage (extended) I want to serialize the objects and when i am deserizaling i dont know if i am getting FileMessage or ChatMessage. So how to get that object and use it I have written following code for serialization public void Send(Message message) { NetworkStream netWorkStream=null; try { XmlSerializer serializer=new XmlSerializer(message.GetType()); netWorkStream=new NetworkStream(_clientSocket); Stream stream=(Stream)netWorkStream; serializer.Serialize(stream,message); } finally { netWorkStrea...

Manually Data Collection
In Manufacturing we are doing Manually DC to get information about Ok an Rejection work on each and every opertation with in a Routing. During this process i found that DC Activity not attached with my MO, for exemple 1. I can enter any qty in Piece Ok or Rejected fields even if the Mo Qty 100 but for the same MO Data Collection can be done for 1000pcs. 2. In data collection form no information about MO Quantities. 3. As my operations are based on piece work bases and each operation in routing have diffrent rates as well labor, so when I am entring the MO receipt entry again there is no ...

Collecting form data offline
I've created a simple CRM database suing Access 2007 on our companies share drive. We have a small office with only 5 people using the database. Is it possible to collect from data off line while visiting a client and sync to the database when I'm back in the office? ...

Missing Clip Art options Web & Shared Collections are not showing
In Office 2007, when going to Insert>Clip Art the only options available to Search in are My Collections and Office Collections Both Web Collections and Shared Collections are missing. Can anyone provide assistance with this? Thanks, Mike Have you tried a repair? The Organizer has its own Detect and Repair. You might have to create a new catalog file. Find Mstore10.mgc; change it to Mstore10.old. A new catalog will be created the next time you open the Organizer. The Mstore10.mgc is in a folder similar to this (hidden) C:\Users\<<user name>>\AppData\Roaming\...

XMLSerializer Serialize
Iam trying to create a xml file by serializing a custom business object. Iam using a xmltextwriter, but the problem there are invalid characters at the end of the generated file anyone knows a way around it ? tia Dim myStream As New IO.MemoryStream Dim myXMLWriter As New System.Xml.XmlTextWriter(myStream, System.Text.Encoding.UTF8) myXMLWriter.Formatting = System.Xml.Formatting.Indented Dim myShipments As OrderShipments myShipments = CType(myOrder.OrderAddresses(0), COrderAddress).Shipments myShipments.ToXML(myXMLWriter) ...

XmlSerializer help
Hi, I have a class: public class Note { public string name; public string information; } And i Serialize this class, but want to Serialize it to an XmlDocument which will contain many of these elements. How do i do this? Thank you, Tim. Timothy, take a look at Chris Lovett's XmlNodeWriter on www.gotdotnet.com [0]. Simply pass the node where you want to insert the serialized XML into the XmlDocument to an XmlNodeWriter and pass the XmlNodeWriter to the Serialize method. -- HTH Christoph Schittko [MVP] Software Architect, .NET Mentor [0] http://gotdotnet.com/Communit...

Does anybody have a CD collection template
I have many CD's and program CD's, but I can never easily find in what rack and in what place in the rack the CD is located at. Is there a template that I can use, to show location, title, version etc?. I'm sure I can make regular columns with that kind of a heading, but maybe there is a nice looking template available that some one would share with me...........Opa Maybe you can adapt one of these http://office.microsoft.com/en-us/results.aspx?Query=inventory&Scope=TC&QueryID=mMV6o9dDy&TRC=35&iStartAt=1 or, try a google search. tj "PeterM" wrote...

POP3 will not collect email (sometimes)
I have a strange problem with MS SBS running Exchange 2003. I have three servers for three different companies all experiencing the same problem. (all running pop3). (in case your wondering the local ISP charge $45 per month for a DSL static IP, STOP laughing, its just how it is when there is a monopoly) Anyway, back to the story. ALL 3 sites fail to collect mail once out of every three or four tries. Even though DNS resolves the pop3 server happily I changed the pop3 server, within exchange, to the IP of the ISP (don't have to resolve DNS no more). This now works every time....

collection letter #2
I am trying to create collection letters to include all A/R detail. I have managed to include the invoice detail but this does not show any payments, returns or credit memos. Is there a way to include these? We have been using a modified trial balance as a statement to show all activity and have it aged in buckets. This requires an additional cover sheet since there is no easy way to have this report formatted to align in a window envelope. This is a time consuming task. I do not like the statements that are generated using the sales routines since that includes every transaction ...

Problems with XmlSerializer and namespaces
I have an object, Teacher, that has a namespace. Let's call it http://foo. Teacher has a child object called Name, composed of String first, middle, last, etc. Problem I have is when I try to deserialize it. When I deserialize a single Teacher, it works when I put the namespace on the Teacher element. However, if I have just the namespace on Teacher, it will deserialize fine as Teacher. *However*, if I try to deserialize an ArrayOfTeacher, Teacher.Name doesn't deserialize (it's null); without the array, it's OK. What I wound up doing was serializing both a Teacher ...

How Collect Some Start Menu Items into a Group?
I have several menu items related to audio, and I'd like to group them under a single topic. How do I create some entry to move them to? Just create a new folder, then put the shortcuts into it. The Start Menu folders are found here: C:\Documents and Settings\All Users\Start Menu\Programs C:\Documents and Settings\{username}\Start Menu\Programs ju.c "W. eWatson" <wolftracks@invalid.com> wrote in message news:hf05nq$gub$1@news.eternal-september.org... > I have several menu items related to audio, and I'd like to group them > under a single t...

Detail Tax Collected and Tax Analysis report totals should match
The 'Detail Tax Collected' and 'Tax Analysis' report totals do not match. We know the reasoning is that the 'Tax Analysis' report rounds the totals, which causes the two reports to be off by just a few cents to sometimes a few dollars. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click &...

XmlSerializer and ICollection
Hello all, I have two simple classes: Item and ItemCollection. Item stores a label for the item and an instance of ItemCollection for all child items. ItemCollection just stores a collection of Items. ItemCollection implements System.Collections.ICollection. When I use XmlSerializer to serialize an instance of ItemCollection, I am unable to control the element names used to contain the item collection and the items therein. Applying XmlRootAttribute to the ItemCollection class causes an exception because it implements ICollection. I have also tried implementing IXmlSerializer in my ItemColl...

Collecting multiple feeds
Folks, I am subscribed to about 30 radio podcast feeds. When I refresh them on any given day, there will be five or six that refresh, and on Friday, there are about twelve. For each one, I click the URL in the feed, which opens the site for that radio program. Then I right-click the link to the podcast and select Save Target As... As it all goes onto the same directory on an MP3 player, I don't have to select it each time, but when the download frame comes up, I have to click the Save button. As most of these programs come from the BBC site, which only allows two si...

All Beautiful Collections Here!!==Open It!!
All Beautiful Collections Here!!==Open It!! http://fundhoax.blogspot.com/ ...

XmlSerializer question
Hi, I use XmlSerializer to serialize xml string. It escapes xml special charaters, like < and > to < and >. How can I stop XmlSerializer to escape these charaters? Thanks in advance!!! Cindy Cindy wrote: > I use XmlSerializer to serialize xml string. It escapes xml special > charaters, like < and > to < and >. How can I stop XmlSerializer to escape > these charaters? If the XmlSerializer didn't escape the characters < and & (and for compatibility >), then the result would not be well-formed XML. See section 2.4 of the XML specification [1]...

XmlSerializer and DefaultValue?
Hello, I'm currently playing around with the XmlSerializer to replace my old handmade Xml parsing code, but am having a few small issues with default values and derived classes. Say we have classes A, B and C: abstract class A { protected int a_value = 1; [XmlAttribute("value"), DefaultValue(1)] public int AValue { get { return a_value; } set { a_value = value; } } } class B : A { .... } class C : A { .... } Now, I want class B and C to have different default values, more precisely, I want B to have 1 as default value and C to have Int32.MaxValue. But I ...

XmlSerializer question...
Hi All, When using XmlSerializer is there anyway of keeping "xsi", "xsd" namespaces and PI appearing in the xml file ? <?xml version="1.0"?> <myClass xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="Test" Visible="false" /> Just want a simple clean one like the following... <ColumnInfo Name="Test" Visible="false" /> Thanks, Maersa wrote: > When using XmlSerializer is there anyway of keeping "xsi", "xsd"...

How to XMLSerialize Collection Class
Hi, I have a collection class where I've implemeneted the ICollection Interface. Here is a small code segment. public class PageList : ICollection, IComparer, IEnumerable, IList { protected ArrayList _pages; public PageList() { _pages = new ArrayList(); } #region IList Members public object this[int index] { get { if (index > _pages.Count) { return (Page)null; } else { return (Page)_pages [index]; } } set { } } public int Add(object objPage) { int arrayIndexAdded = -1; arrayIndexAdded = _pages.A...

XMLSerializer for javascript
Hello, Can XMLSerializer be called from javascript ? How can I use XMLSerializer on the client side, and on the server side ? I need an example, please. Thanks :) Mr. x wrote: > Can XMLSerializer be called from javascript ? Not in javascript, but in JScript.NET. > How can I use XMLSerializer on the client side, and on the server side ? XmlSerializer (if you're talking about System.Xml.Serialization.XmlSerializer class of .NET) requires .NET environment. On server side it's usually ASP.NET, on client side - Windows forms or Web Forms. -- Oleg Tkachenko http://www.tkachen...

collection of videos and tutorials on MS excel:Add-in.
A link to a collection of videos and tutorials on MS excel:Add-in. Tutorials: http://www.dataminingtools.net/browsetutorials.php?tag=msexcel Videos: http://www.dataminingtools.net/videos.php?id=11 datakid .. wrote: > A link to a collection of videos and tutorials on MS excel:Add-in. > > Tutorials: http://www.dataminingtools.net/browsetutorials.php?tag=msexcel > > Videos: http://www.dataminingtools.net/videos.php?id=11 That's interesting, but since the add-in requires Excel 2007, it makes no sense to post it to a newsgroup dedicated to a different version of Excel. We ...