public async Task <IceCatProduct> GetAsync(long productId) { var req = RequestEngine.CreateClient(_AccessConfig); var productXmlUrl = BuildXmlFileUrl($"{productId}.xml"); var productXml = await RequestEngine.GetAsStringAsync(req, productXmlUrl); return(CustomXmlParser.Parse <IceCatProduct>(productXml, "Product")); }
public async Task <string> GetAsync(string xmlUrlPath, string nodeName = null) { var req = RequestEngine.CreateClient(_AccessConfig); var xmlBody = await RequestEngine.GetAsStringAsync(req, xmlUrlPath); if (string.IsNullOrEmpty(nodeName)) { return(xmlBody); } return(await CustomXmlParser.ParseAsync(nodeName, xmlBody)); }
protected void ManipulatePdf(String dest) { PdfDocument pdfDoc = new PdfDocument(new PdfReader(SRC), new PdfWriter(dest)); Document doc = new Document(pdfDoc); PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true); // If no fields have been explicitly included, then all fields are flattened. // Otherwise only the included fields are flattened. form.FlattenFields(); Rectangle pos = form.GetField("Name").GetWidgets()[0].GetRectangle().ToRectangle(); // Custom parser gets position of the form field // to fill in the document with the parsed content. CustomXmlParser parser = new CustomXmlParser(doc, pos); parser.Parse("<root><div>Bruno <u>Lowagie</u></div></root>"); pdfDoc.Close(); }
public IEnumerable <IceCatFile> List() { return(CustomXmlParser.ParseFileToList <IceCatFile>(XmlFilePath, "file")); }
public ActionResult ConvertToXML(string txtInputText) { ViewBag.ParsedText = CustomXmlParser.ToXml(txtInputText); ViewBag.Mode = "xml"; return(View("Index")); }
protected void btnConvertToXML_Click(object sender, EventArgs e) { txtResultXML.Text = CustomXmlParser.ToXml(txtInputText.Text); }