예제 #1
0
			public override void  startElement(System.String uri, System.String localName, System.String qName, SaxAttributesSupport attributes)
			{
				XLRNode current = null;
				if (context.Count > 0)
				{
					current = (XLRNode) context[context.Count - 1];
				}
				
				// common shortcuts...
				System.String locale = attributes.GetValue("locale");
				if (locale == null)
					locale = fileLocale;
				System.String text = attributes.GetValue("text");
				
				XLRNode node = null;
				if ("messages".Equals(qName))
				{
					fileLocale = attributes.GetValue("locale");
					if (attributes.GetValue("idbase") != null)
						base_Renamed = attributes.GetValue("idbase");
				}
				else if ("message".Equals(qName))
				{
					System.String id = attributes.GetValue("id");
					
					if (base_Renamed != null)
						id = base_Renamed + "." + id;
					
					node = (XLRMessageNode) nodedict[id];
					if (node == null)
					{
						node = new XLRMessageNode(id);
						nodedict[id] = node;
					}
					if ((text != null) && (locale != null))
					// check errors
					{
						XLRTargetNode targetNode = new XLRTargetNode(locale);
						node.children.Add(targetNode);
						XLRTextNode textNode = new XLRTextNode(text);
						targetNode.children.Add(textNode);
					}
					
					
					context.Add(node);
				}
				else if ("target".Equals(qName))
				{
					node = new XLRTargetNode(locale);
					if (text != null)
						node.children.Add(new XLRTextNode(text));
					
					current.children.Add(node);
					context.Add(node);
				}
				else if ("text".Equals(qName))
				{
					System.String value_Renamed = attributes.GetValue("value");
					
					node = new XLRTextNode(value_Renamed);
					
					current.children.Add(node);
					context.Add(node);
				}
				else if ("variable".Equals(qName))
				{
					System.String name = attributes.GetValue("name");
					
					node = new XLRVariableNode(name);
					current.children.Add(node);
					context.Add(node);
				}
				else if ("match".Equals(qName))
				{
					node = new XLRMatchNode(attributes.GetValue("variable"), attributes.GetValue("pattern"));
					if (text != null)
						node.children.Add(new XLRTextNode(text));
					
					current.children.Add(node);
					context.Add(node);
				}
				else if ("select".Equals(qName))
				{
					node = new XLRChoiceNode();
					current.children.Add(node);
					context.Add(node);
				}
				else
				{
					//UPGRADE_ISSUE: Constructor 'org.xml.sax.SAXParseException.SAXParseException' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_orgxmlsaxSAXParseExceptionSAXParseException_javalangString_orgxmlsaxLocator'"
					throw new SAXParseException("blorp", null); // fixme
				}
			}
예제 #2
0
            public override void  startElement(System.String uri, System.String localName, System.String qName, SaxAttributesSupport attributes)
            {
                XLRNode current = null;

                if (context.Count > 0)
                {
                    current = (XLRNode)context[context.Count - 1];
                }

                // common shortcuts...
                System.String locale = attributes.GetValue("locale");
                if (locale == null)
                {
                    locale = fileLocale;
                }
                System.String text = attributes.GetValue("text");

                XLRNode node = null;

                if ("messages".Equals(qName))
                {
                    fileLocale = attributes.GetValue("locale");
                    if (attributes.GetValue("idbase") != null)
                    {
                        base_Renamed = attributes.GetValue("idbase");
                    }
                }
                else if ("message".Equals(qName))
                {
                    System.String id = attributes.GetValue("id");

                    if (base_Renamed != null)
                    {
                        id = base_Renamed + "." + id;
                    }

                    node = (XLRMessageNode)nodedict[id];
                    if (node == null)
                    {
                        node         = new XLRMessageNode(id);
                        nodedict[id] = node;
                    }
                    if ((text != null) && (locale != null))
                    // check errors
                    {
                        XLRTargetNode targetNode = new XLRTargetNode(locale);
                        node.children.Add(targetNode);
                        XLRTextNode textNode = new XLRTextNode(text);
                        targetNode.children.Add(textNode);
                    }


                    context.Add(node);
                }
                else if ("target".Equals(qName))
                {
                    node = new XLRTargetNode(locale);
                    if (text != null)
                    {
                        node.children.Add(new XLRTextNode(text));
                    }

                    current.children.Add(node);
                    context.Add(node);
                }
                else if ("text".Equals(qName))
                {
                    System.String value_Renamed = attributes.GetValue("value");

                    node = new XLRTextNode(value_Renamed);

                    current.children.Add(node);
                    context.Add(node);
                }
                else if ("variable".Equals(qName))
                {
                    System.String name = attributes.GetValue("name");

                    node = new XLRVariableNode(name);
                    current.children.Add(node);
                    context.Add(node);
                }
                else if ("match".Equals(qName))
                {
                    node = new XLRMatchNode(attributes.GetValue("variable"), attributes.GetValue("pattern"));
                    if (text != null)
                    {
                        node.children.Add(new XLRTextNode(text));
                    }

                    current.children.Add(node);
                    context.Add(node);
                }
                else if ("select".Equals(qName))
                {
                    node = new XLRChoiceNode();
                    current.children.Add(node);
                    context.Add(node);
                }
                else
                {
                    //UPGRADE_ISSUE: Constructor 'org.xml.sax.SAXParseException.SAXParseException' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_orgxmlsaxSAXParseExceptionSAXParseException_javalangString_orgxmlsaxLocator'"
                    throw new SAXParseException("blorp", null);                     // fixme
                }
            }