internal Property MakeProperty(PropertyList propertyList, string propertyName) { Property p = null; PropertyMaker propertyMaker = FindMaker(propertyName); if (propertyMaker != null) { p = propertyMaker.Make(propertyList); } else { FonetDriver.ActiveDriver.FireFonetWarning("property " + propertyName + " ignored"); } return(p); }
/// <summary> /// Return a property value for a compound property. If the property /// value is already partially initialized, this method will modify it. /// </summary> /// <param name="baseProp"> /// The Property object representing the compound property, such as /// SpaceProperty. /// </param> /// <param name="partName">The name of the component whose value is specified.</param> /// <param name="propertyList">The propertyList being built.</param> /// <param name="value"></param> /// <param name="fo">The FO whose properties are being set.</param> /// <returns>A compound property object.</returns> public Property Make(Property baseProp, string partName, PropertyList propertyList, string value, FObj fo) { if (baseProp == null) { baseProp = MakeCompound(propertyList, fo); } PropertyMaker spMaker = GetSubpropMaker(partName); if (spMaker != null) { Property p = spMaker.Make(propertyList, value, fo); if (p != null) { return(SetSubprop(baseProp, partName, p)); } } return(baseProp); }
internal PropertyList MakeList( string ns, string elementName, Attributes attributes, FObj parentFO) { Debug.Assert(ns != null, "Namespace should never be null."); string space = "http://www.w3.org/TR/1999/XSL/Format"; if (ns != null) { space = ns; } PropertyList parentPropertyList = parentFO != null ? parentFO.properties : null; PropertyList par = null; if (parentPropertyList != null && space.Equals(parentPropertyList.GetNameSpace())) { par = parentPropertyList; } PropertyList p = new PropertyList(par, space, elementName); p.SetBuilder(this); StringCollection propsDone = new StringCollection(); string fontsizeval = attributes.getValue(FONTSIZEATTR); if (fontsizeval != null) { PropertyMaker propertyMaker = FindMaker(FONTSIZEATTR); if (propertyMaker != null) { try { p.Add(FONTSIZEATTR, propertyMaker.Make(p, fontsizeval, parentFO)); } catch (FonetException) { } } propsDone.Add(FONTSIZEATTR); } for (int i = 0; i < attributes.getLength(); i++) { string attributeName = attributes.getQName(i); int sepchar = attributeName.IndexOf('.'); string propName = attributeName; string subpropName = null; Property propVal = null; if (sepchar > -1) { propName = attributeName.Substring(0, sepchar); subpropName = attributeName.Substring(sepchar + 1); } else if (propsDone.Contains(propName)) { continue; } PropertyMaker propertyMaker = FindMaker(propName); if (propertyMaker != null) { try { if (subpropName != null) { Property baseProp = p.GetExplicitBaseProperty(propName); if (baseProp == null) { string baseValue = attributes.getValue(propName); if (baseValue != null) { baseProp = propertyMaker.Make(p, baseValue, parentFO); propsDone.Add(propName); } } propVal = propertyMaker.Make(baseProp, subpropName, p, attributes.getValue(i), parentFO); } else { propVal = propertyMaker.Make(p, attributes.getValue(i), parentFO); } if (propVal != null) { p[propName] = propVal; } } catch (FonetException e) { FonetDriver.ActiveDriver.FireFonetError(e.Message); } } else { if (!attributeName.StartsWith("xmlns")) { FonetDriver.ActiveDriver.FireFonetWarning( "property " + attributeName + " ignored"); } } } return(p); }