Пример #1
0
        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"));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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();
        }
Пример #4
0
 public IEnumerable <IceCatFile> List()
 {
     return(CustomXmlParser.ParseFileToList <IceCatFile>(XmlFilePath, "file"));
 }
Пример #5
0
 public ActionResult ConvertToXML(string txtInputText)
 {
     ViewBag.ParsedText = CustomXmlParser.ToXml(txtInputText);
     ViewBag.Mode       = "xml";
     return(View("Index"));
 }
Пример #6
0
 protected void btnConvertToXML_Click(object sender, EventArgs e)
 {
     txtResultXML.Text = CustomXmlParser.ToXml(txtInputText.Text);
 }