ToQname() 개인적인 메소드

private ToQname ( ) : Rhino.Xmlimpl.XmlNode.QName
리턴 Rhino.Xmlimpl.XmlNode.QName
예제 #1
0
파일: XML.cs 프로젝트: hazzik/Rhino.Net
		internal virtual Rhino.Xmlimpl.XML MakeXmlFromString(XMLName name, string value)
		{
			try
			{
				return NewTextElementXML(this.node, name.ToQname(), value);
			}
			catch (Exception e)
			{
				throw ScriptRuntime.TypeError(e.Message);
			}
		}
예제 #2
0
파일: XML.cs 프로젝트: hazzik/Rhino.Net
		internal override XMLList Child(XMLName xmlName)
		{
			//    TODO    Right now I think this method would allow child( "@xxx" ) to return the xxx attribute, which is wrong
			XMLList rv = NewXMLList();
			//    TODO    Should this also match processing instructions?  If so, we have to change the filter and also the XMLName
			//            class to add an acceptsProcessingInstruction() method
			Rhino.Xmlimpl.XmlNode[] elements = this.node.GetMatchingChildren(Rhino.Xmlimpl.XmlNode.Filter.ELEMENT);
			for (int i = 0; i < elements.Length; i++)
			{
				if (xmlName.MatchesElement(elements[i].GetQname()))
				{
					rv.AddToList(ToXML(elements[i]));
				}
			}
			rv.SetTargets(this, xmlName.ToQname());
			return rv;
		}
예제 #3
0
파일: XML.cs 프로젝트: hazzik/Rhino.Net
		internal virtual void SetAttribute(XMLName xmlName, object value)
		{
			if (!IsElement())
			{
				throw new InvalidOperationException("Can only set attributes on elements.");
			}
			//    TODO    Is this legal, but just not "supported"?  If so, support it.
			if (xmlName.Uri() == null && xmlName.LocalName().Equals("*"))
			{
				throw ScriptRuntime.TypeError("@* assignment not supported.");
			}
			this.node.SetAttribute(xmlName.ToQname(), ScriptRuntime.ToString(value));
		}
예제 #4
0
파일: XML.cs 프로젝트: hazzik/Rhino.Net
		internal override XMLList Elements(XMLName name)
		{
			XMLList rv = NewXMLList();
			rv.SetTargets(this, name.ToQname());
			//    TODO    Should have an XMLNode.Filter implementation based on XMLName
			Rhino.Xmlimpl.XmlNode[] elements = this.node.GetMatchingChildren(Rhino.Xmlimpl.XmlNode.Filter.ELEMENT);
			for (int i = 0; i < elements.Length; i++)
			{
				if (name.Matches(ToXML(elements[i])))
				{
					rv.AddToList(ToXML(elements[i]));
				}
			}
			return rv;
		}
예제 #5
0
파일: XMLList.cs 프로젝트: hazzik/Rhino.Net
		private Rhino.Xmlimpl.XMLList GetPropertyList(XMLName name)
		{
			Rhino.Xmlimpl.XMLList propertyList = NewXMLList();
			Rhino.Xmlimpl.XmlNode.QName qname = null;
			if (!name.IsDescendants() && !name.IsAttributeName())
			{
				// Only set the targetProperty if this is a regular child get
				// and not a descendant or attribute get
				qname = name.ToQname();
			}
			propertyList.SetTargets(this, qname);
			for (int i = 0; i < Length(); i++)
			{
				propertyList.AddToList(GetXmlFromAnnotation(i).GetPropertyList(name));
			}
			return propertyList;
		}